Previous Thread
Next Thread
Print Thread
Page 14 of 16 1 2 12 13 14 15 16
Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: Golden Child] #111382
11/26/17 10:18 AM
11/26/17 10:18 AM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member
G
Joined: Feb 2014
Posts: 146
Or how about ask the user if they'd like to exit.

If so, then pass a nil result through.

Code
local lnresult = ln.linenoise('\x1b[1;36m[MAME]\x1b[0m> ')
if (lnresult == nil) then 
  lnresult = "" 
  io.write("CTRL+C detected: are you sure you want to exit?") 
  if io.read() == "y" then lnresult = nil end 
end
return lnresult
]]

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: Golden Child] #111501
12/04/17 12:29 PM
12/04/17 12:29 PM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member
G
Joined: Feb 2014
Posts: 146
So a couple of things I was trying to figure out,
1. how to print to another text console, and
2. how often register_periodic will call a routine.


So how to send lua print output to another text console.

I would get lots of output information that would mess up my command line, so why not send it to another window?

On ubuntu 17.10, you can launch an xterm with a command line like:
Code
xterm -e "tty;cat" &

So it executes the program tty which prints something like "/dev/pts/3" on the top line which is the pseudoterminal assigned to the terminal and then executes cat. The & is to run it in the background so you get your console back.

I tried it with "gnome-terminal -- tty;cat" but it didn't seem to work, giving me some kind of error.

I launch mame with this command line:

Code
./mame64 a2600 stampede -plugin console -debug -window  2>/dev/pts/3


so the 2> redirects stderr to my freshly created xterm at /dev/pts/3.

and any error messages from lua goes to stderr and I can also print stuff directly with

Code
io.stderr:write("This goes to stderr\n")




I was trying to figure out how often a routine registered to emu().register_periodic would get called:

Code
function testperiodic() if not stopprint then if cycles == nil then cycles = 1 end io.stderr:write(" cycles="..(cycles).."  "..os.date().."\n") if cycles then cycles=cycles+1 end end end

-- same function on multiple lines:

function testperiodic() 
  if not stopprint then 
    if cycles == nil then cycles = 1 end 
    io.stderr:write(" cycles="..(cycles).."  "..os.date().."\n") 
    if cycles then cycles=cycles+1 end 
  end 
end

emu.register_periodic(testperiodic)


-- and when you want to stop the printing, set stopprint to true
-- stopprint=true


and you get output like:
Code
 cycles=1  Mon 04 Dec 2017 04:05:44 PM EST
 cycles=2  Mon 04 Dec 2017 04:05:44 PM EST
 cycles=3  Mon 04 Dec 2017 04:05:44 PM EST
 cycles=4  Mon 04 Dec 2017 04:05:44 PM EST
 cycles=5  Mon 04 Dec 2017 04:05:44 PM EST
 cycles=6  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=7  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=8  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=9  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=10  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=11  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=12  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=13  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=14  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=15  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=16  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=17  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=18  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=19  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=20  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=21  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=22  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=23  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=24  Mon 04 Dec 2017 04:05:45 PM EST
 cycles=25  Mon 04 Dec 2017 04:05:46 PM EST


And it looks like you get around 20 cycles per second.

And if you want other terminal output windows, you can use io.open like so:
Code
[MAME]> out2 = io.open("/dev/pts/4","w")
[MAME]> print(out2)
file (0x56300b8219b0)
[MAME]> out2:write("hello wont be seen until newline")
[MAME]> out2:write("hello\n")
[MAME]> out2:write("wont see me until flush")
[MAME]> out2:flush()


Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #112860
03/13/18 02:26 PM
03/13/18 02:26 PM
Joined: May 2012
Posts: 466
S
shattered Offline
Senior Member
shattered  Offline
Senior Member
S
Joined: May 2012
Posts: 466
Working on Apple disk support in SAMdisk -- this is a (probably cracked) Datasoft Conan disk. And it boots when converted into .DO image:

[Linked Image]

Code
[a140-023.scp]
35 Cyls Head 0:
cyl 32 head 0 sec 6: invalid gcr at 016 - A5 -> FF
cyl 32 head 0 sec 6: invalid gcr at 017 - 7B -> FF
cyl 32 head 0 sec 6: invalid gcr at 01E - 7F -> FF
cyl 32 head 0 sec 6: invalid gcr at 01F - D5 -> FF
cyl 32 head 0 sec 6: invalid gcr at 020 - 93 -> FF
cyl 32 head 0 sec 6: invalid gcr at 021 - A9 -> FF
250Kbps Apple, 16 sectors,  256 bytes/sector:
  0.0  5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4
  1.0  10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9
  2.0  14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13
  3.0  2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1
  4.0  7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6
  5.0  11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10
  6.0  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  7.0  4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3
  8.0  9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8
  9.0  13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12
 10.0  2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1
 11.0  6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5
 12.0  11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10
 13.0  15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
 14.0  4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3
 15.0  8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
 16.0  13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12
 17.0  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0
 18.0  14 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13
 19.0  2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1
 20.0  7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6
 21.0  11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10
 22.0  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
 23.0  4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3
 24.0  9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8
 25.0  13 14 15 0 1 2 3 4 5 6 7 8 9 10 11 12
 26.0  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0
 27.0  6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5
 28.0  11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 10
 29.0  15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
 30.0  3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2
 31.0  8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
 32.0  12 13 14 15 0 1 2 3 4 5 6 7 8 9 10 11
 33.0  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0
 34.0  5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #112861
03/13/18 02:44 PM
03/13/18 02:44 PM
Joined: Mar 2001
Posts: 15,964
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,964
USA
Very nice!

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #113096
04/11/18 11:04 AM
04/11/18 11:04 AM
Joined: Oct 2015
Posts: 9
R
robj Offline
Member
robj  Offline
Member
R
Joined: Oct 2015
Posts: 9
Not to sure where to post this, but this seems like a good place.

One of the members of the Apple /// Facebook group, Madeleine, has noticed an issue in the Apple /// emulation when writing to floppy images. This was noticed when trying to use MAME to help speed up some A3 driver development. After a few operations writing to the disk, then some corruption happens and the disk image will not work anymore.

It is easily reproducable and looks like its been there for quite some time, the current 0.196 has it, and looks like back to 0.158, but 0.153 is ok.

You can test and reproduce with the following disk image:
http://www.apple3.org/Software/programming/basic/Apple3BusBasic.dsk

1. Boot the dsk image mounted as flop1
2. type 'load volumes' (read a basic program to save in)
3. repeat saving the same file many times 'save volumes1', 'save volumes2' ..etc
4. Error can occur after 1 or 2 times, or may take quite a bit more. Looks like you can get two things that happen when the write errors occur
- ?VOLUME NOT FOUND - then the disk directory blocks seem trashed, you can see this if you open up the dks image in ciderpress using the block viewer
- ?I/O ERROR - cannot save after this, but can do a CATALOG but this shows errors. Again, I think the directory sector is trashed some how.

I'm wondering if someone can have a look at why this might be happening?

/Robj

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: robj] #113098
04/11/18 02:18 PM
04/11/18 02:18 PM
Joined: Apr 2012
Posts: 208
UK
Pernod Offline
Senior Member
Pernod  Offline
Senior Member
Joined: Apr 2012
Posts: 208
UK
Originally Posted by robj
It is easily reproducable and looks like its been there for quite some time, the current 0.196 has it, and looks like back to 0.158, but 0.153 is ok.

I don't think this is specific to the Apple or any particular format as I've also had BBC users reporting to me something similar. I have been able to replicate the issue myself with bbcb and a ssd format floppy and it seems to insert an extra byte after the first sector rendering the image corrupt. Haven't yet investigated further as it seems core floppy image related.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #113194
04/23/18 03:26 AM
04/23/18 03:26 AM
Joined: Feb 2014
Posts: 146
G
Golden Child Offline
Senior Member
Golden Child  Offline
Senior Member
G
Joined: Feb 2014
Posts: 146
I was reading up on the Apple2 game subnodule at John Romero's website and thought I'd give it a spin in Mame's apple2e driver and it doesn't work.

./mame64 apple2e -flop1 subnodule.dsk

and it drops out to the monitor right after booting.

It's quite a good read.

http://rome.ro/subnodule/

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #113195
04/23/18 11:49 AM
04/23/18 11:49 AM
Joined: Mar 2001
Posts: 15,964
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,964
USA
Yeah, the boot sector loads what appears to be invalid data and jumps to it, even if I switch to the old HLE disk controller. I'll take a more detailed look later today unless Peter Ferrie sees it first smile

Last edited by R. Belmont; 04/23/18 05:50 PM.
Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #113199
04/23/18 07:32 PM
04/23/18 07:32 PM
Joined: Jun 2014
Posts: 70
P
peter ferrie Offline
Member
peter ferrie  Offline
Member
P
Joined: Jun 2014
Posts: 70
Maybe I need a notification subscription, because I saw this only by accident.
The sectors are ProDOS order (0, E, D, C...), not DOS order (0, 1, 2, 3...).
It works in AppleWin, for example, because they don't do the right thing.
It's not a bug, and not MAME's fault.
Reording the sectors will give you a good image. Do you need me to send one?

Re: 8bit Apples - Apple I, II, /// and the 16 bit GS [Re: rfka01] #113200
04/23/18 07:38 PM
04/23/18 07:38 PM
Joined: Mar 2001
Posts: 15,964
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,964
USA
I can add a heuristic to detect this disk. We already do for a bunch of them. Wasn't quite expecting the disk to be ProDOS order since it has a DOS 3.3-looking BOOT0, but you never know smile

Last edited by R. Belmont; 04/23/18 07:39 PM.
Page 14 of 16 1 2 12 13 14 15 16

Who's Online Now
2 registered members (2 invisible), 25 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,553
Posts111,744
Members4,800
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.045s Queries: 15 (0.021s) Memory: 5.7381 MB (Peak: 5.9617 MB) Zlib enabled. Server Time: 2018-07-16 21:40:15 UTC