b2 - new emulator

want to talk about MESS/model b/beebem/b-em/electrem/elkulator? do it here!
VectorEyes
Posts: 269
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: b2 - new emulator

Post by VectorEyes » Fri Jun 01, 2018 12:17 pm

Hello!

I've been playing with B2. It's nice and easy to download and build on Windows. :)

I wanted to see whether there was any way to quickly load a program, and set data read/write breakpoints. The debugger read/write breakpoint functionality is all present and correct in the codebase, but I couldn't see any way to access it from any of the menus.

Am I missing something obvious, or is debugger breakpoint handling something that hasn't been hooked up to the GUI yet?

(Apart from that slight snag ... I really like the modularity and structure of the code!)

Edit: Ah... are the memory read/write breakpoints meant to be accessed from the "Options" button on the Memory View? That's crashing with a string formatting runtime error when I click it. Time to put my (C++, not 6502) debugging hat on!

Edit 2: OK, I fixed the bug, got the "options" window running ... but it doesn't handle read/write points. Damn!

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Mon Jun 04, 2018 11:48 pm

VectorEyes wrote:
Fri Jun 01, 2018 12:17 pm
Hello!

I've been playing with B2. It's nice and easy to download and build on Windows. :)

I wanted to see whether there was any way to quickly load a program, and set data read/write breakpoints. The debugger read/write breakpoint functionality is all present and correct in the codebase, but I couldn't see any way to access it from any of the menus.

Am I missing something obvious, or is debugger breakpoint handling something that hasn't been hooked up to the GUI yet?

(Apart from that slight snag ... I really like the modularity and structure of the code!)

Edit: Ah... are the memory read/write breakpoints meant to be accessed from the "Options" button on the Memory View? That's crashing with a string formatting runtime error when I click it. Time to put my (C++, not 6502) debugging hat on!

Edit 2: OK, I fixed the bug, got the "options" window running ... but it doesn't handle read/write points. Damn!
Thanks for the kind words, and I'm glad you found it easy to build. Building dependency-heavy stuff on Windows usually seems to be a massive pain, or at least I've always found it so, and I wanted b2 to be different ;)

And I've fixed the hex editor, thanks for the report, probably by doing exactly the same thing you did.

Regarding the breakpoints, you're quite right - these aren't exposed yet. I'll be working on this next - my current plan being to expose breakpoint flags everywhere you see the value or address of a byte in memory: hex view (addresses and columns), disassembly view (addresses, bytes, operands, effective addresses), 6502 status view, and wherever else one is displayed.

Exact UI here TBC, but it'll probably involve using colours to indicate current status, I should think, or maybe little dots, etc., plus a hover tooltip type of thing for more detail. Then remove the breakpoint tickboxes in the disassembly panel... they're a bit useless, as they only reflect execution breakpoints, and then only for the address of the first byte of that instruction.

Then add breakpoints list panel, some easy way of adding breakpoints in bulk, and be more consistent about using JGH's addressing scheme (or similar), so it's obvious when you're setting a breakpoint in shadow RAM vs normal RAM, and so on. This will need a bit more fiddling with when I get debug symbol support in, but that can wait for now...

--Tom

User avatar
lurkio
Posts: 2210
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: b2 - new emulator

Post by lurkio » Sun Sep 02, 2018 2:19 pm

Hi. So I updated my clean install of macOS High Sierra (which is on an external hard-drive) with the latest software update from Apple and tried again to download and run the latest release of b2, but I'm getting the same problem I had before on Yosemite -- the b2 app launches, but the window is completely black, and you can't do anything. The only menu bar I can see is the standard Apple menu bar at the top of the screen, with menus named b2, Window, and View.

Here's the Console log, if it's of any use:

Code: Select all

default	15:11:19.407584 +0100	trustd	could not enable test hierarchy: no UAT pinning preferences set
default	15:11:20.957099 +0100	CommCenter	#I handleLSNotitifcation_sync: Application launched: <private>
default	15:11:20.958068 +0100	taskgated	MacOS error: -67062
default	15:11:20.965296 +0100	lsd	UNIX error exception: 8
default	15:11:20.966077 +0100	mds	directQueryFetchResultsReply 237571 1795162144 35
default	15:11:20.966411 +0100	mds	directQueryFetchResultsReply 237569 1795162144 35
default	15:11:20.998717 +0100	launchservicesd	UNIX error exception: 22
default	15:11:21.001190 +0100	launchservicesd	MacOS error: -67062
default	15:11:21.003675 +0100	launchservicesd	CHECKIN:0x0-0x48048 1192 com.tom-seddon.b2
default	15:11:21.083508 +0100	b2	IOHIDDeviceClass::start: elementCount=14 reportHandlerCount=3
default	15:11:21.083542 +0100	b2	IOHIDDeviceClass::buildElements: type=0 *buffer=7fdc11048a30 *count=14 size=1344
default	15:11:21.083573 +0100	b2	IOHIDDeviceClass::buildElements: type=1 *buffer=7fdc10d0e790 *count=3 size=288
default	15:11:21.085830 +0100	powerd	Process b2.1192 Created PreventUserIdleDisplaySleep "b2 using SDL_DisableScreenSaver" age:00:00:00  id:21474869855 [System: PrevDisp DeclUser IntPrevDisp kDisp]
default	15:11:21.090298 +0100	coreaudiod	HALS_IOContextDescription.cpp:1113:PushStreamUsageToEngines_block_invoke:  IOContext 95: pushing 1 input stream(s) to 'AppleHDAEngineInput:1B,0,1,0:1'
default	15:11:21.090329 +0100	coreaudiod	HALS_IOContextDescription.cpp:1117:PushStreamUsageToEngines_block_invoke:  IOContext 95: input stream[0] => Enabled: 'AppleHDAEngineInput:1B,0,1,0:1'
default	15:11:21.092636 +0100	coreaudiod	HALS_IOContextDescription.cpp:1113:PushStreamUsageToEngines_block_invoke:  IOContext 96: pushing 1 output stream(s) to 'AppleHDAEngineOutput:1B,0,1,1:0'
default	15:11:21.092668 +0100	coreaudiod	HALS_IOContextDescription.cpp:1117:PushStreamUsageToEngines_block_invoke:  IOContext 96: output stream[0] => Enabled: 'AppleHDAEngineOutput:1B,0,1,1:0'
default	15:11:21.094756 +0100	kernel	+ IOAudioEngine[<private>]::newUserClient(0x<private>, <private>, 0x0, 0x0, <private>)
default	15:11:21.094763 +0100	kernel	+ IOAudioEngineUserClient[<private>]::initWithAudioEngine(<private>, 0x<private>, <private>, 0x0, 0x0)
default	15:11:21.094767 +0100	kernel	+- IOAudioEngineUserClient[<private>]::setOnline(0)
default	15:11:21.094770 +0100	kernel	  ConnectionID:0x220a6866
default	15:11:21.094776 +0100	kernel	- IOAudioEngineUserClient[<private>]::initWithAudioEngine(<private>, 0x<private>, <private>, 0x0, 0x0) returns 1
default	15:11:21.094777 +0100	kernel	+- IOAudioEngineUserClient::withAudioEngine(<private>, 0x<private>, <private>, 0x0, 0x0) returns <private>
default	15:11:21.094786 +0100	kernel	+ IOAudioEngine::addUserClientAction(<private>, <private>)
default	15:11:21.094788 +0100	kernel	+- IOAudioEngine[<private>]::addUserClient(<private>) returns 0x0
default	15:11:21.094789 +0100	kernel	- IOAudioEngine::addUserClientAction(<private>, <private>) returns 0x0
default	15:11:21.094791 +0100	kernel	- IOAudioEngine[<private>]::newUserClient(0x<private>, <private>, 0x0, 0x0, <private>)
default	15:11:21.094802 +0100	kernel	- IOAudioEngineUserClient[<private>]::registerFormatNotification(0x<private>, 0x100) returns 0x0
default	15:11:21.094803 +0100	kernel	- IOAudioEngineUserClient::registerNotificationAction(<private>, <private>) returns 0x0
default	15:11:21.094806 +0100	kernel	- IOAudioEngineUserClient[<private>]::registerNotificationPort(0x<private>, 0x0, 0x100) returns 0x0
default	15:11:21.095495 +0100	kernel	+ IOAudioEngine[<private>]::newUserClient(0x<private>, <private>, 0x0, 0x0, <private>)
default	15:11:21.095501 +0100	kernel	+ IOAudioEngineUserClient[<private>]::initWithAudioEngine(<private>, 0x<private>, <private>, 0x0, 0x0)
default	15:11:21.095504 +0100	kernel	+- IOAudioEngineUserClient[<private>]::setOnline(0)
default	15:11:21.095506 +0100	kernel	  ConnectionID:0x1996b38d
default	15:11:21.095511 +0100	kernel	- IOAudioEngineUserClient[<private>]::initWithAudioEngine(<private>, 0x<private>, <private>, 0x0, 0x0) returns 1
default	15:11:21.095512 +0100	kernel	+- IOAudioEngineUserClient::withAudioEngine(<private>, 0x<private>, <private>, 0x0, 0x0) returns <private>
default	15:11:21.095516 +0100	kernel	+ IOAudioEngine::addUserClientAction(<private>, <private>)
default	15:11:21.095518 +0100	kernel	+- IOAudioEngine[<private>]::addUserClient(<private>) returns 0x0
default	15:11:21.095519 +0100	kernel	- IOAudioEngine::addUserClientAction(<private>, <private>) returns 0x0
default	15:11:21.095521 +0100	kernel	- IOAudioEngine[<private>]::newUserClient(0x<private>, <private>, 0x0, 0x0, <private>)
default	15:11:21.095530 +0100	kernel	- IOAudioEngineUserClient[<private>]::registerFormatNotification(0x<private>, 0x101) returns 0x0
default	15:11:21.095531 +0100	kernel	- IOAudioEngineUserClient::registerNotificationAction(<private>, <private>) returns 0x0
default	15:11:21.095534 +0100	kernel	- IOAudioEngineUserClient[<private>]::registerNotificationPort(0x<private>, 0x0, 0x101) returns 0x0
default	15:11:21.100383 +0100	coreaudiod	HALS_IOContextDescription.cpp:1113:PushStreamUsageToEngines_block_invoke:  IOContext 96: pushing 1 output stream(s) to 'AppleHDAEngineOutput:1B,0,1,1:0'
default	15:11:21.100433 +0100	coreaudiod	HALS_IOContextDescription.cpp:1117:PushStreamUsageToEngines_block_invoke:  IOContext 96: output stream[0] => Enabled: 'AppleHDAEngineOutput:1B,0,1,1:0'
default	15:11:21.101747 +0100	AudioComponentRegistrar	144: (main 1  pid 1192)
default	15:11:21.101892 +0100	AudioComponentRegistrar	279: getComponentList includeExtensions: 0
default	15:11:21.115575 +0100	b2	3355: aq@0x7fdc12165600 volume 1.000 1.000 1.000 1.000 1.000
default	15:11:21.116165 +0100	b2	194: AQME device AppleHDAEngineOutput:1B,0,1,1:0: client starting: <AudioQueueObject@0x7fdc12165600; [0]; play>; running count now 1
default	15:11:21.116286 +0100	b2	1026: aqmeio@0x7fdc10e38500, device 0x2e (AppleHDAEngineOutput:1B,0,1,1:0), AudioDeviceStart (err 0)
default	15:11:21.116393 +0100	kernel	+ IOAudioEngineUserClient::externalMethod, selector=0x0,   arg0 0x0, arg1 0x110cd7000, arg2 0x8010 arg3 0x60
default	15:11:21.116400 +0100	kernel	  scalarInputCount=0x4  structureInputSize 0x0, scalarOutputCount 0x0, structureOutputSize 0x0
default	15:11:21.116433 +0100	kernel	+ IOAudioEngineUserClient::registerBuffer64 0x0 0x110cd7000 0x8010 0x60
default	15:11:21.116436 +0100	kernel	+ IOAudioEngineUserClient::safeRegisterClientBuffer64 <private>
default	15:11:21.116440 +0100	kernel	+ IOAudioEngineUserClient[<private>]::registerClientBuffer64  (<private>[1], 0x110cd7000, 0x8010, 0x60)
default	15:11:21.116441 +0100	kernel	  null clientBufferSetList
default	15:11:21.116442 +0100	kernel	  did not find clientBufferSetList for ID 0x60
default	15:11:21.116463 +0100	kernel	  clientBuffer->mAudioClientBuffer32.sourceBuffer before offset: <private>, offset size: 16
default	15:11:21.116464 +0100	kernel	  clientBuffer->mAudioClientBuffer32.sourceBuffer after offset: <private>
default	15:11:21.116465 +0100	kernel	  null clientBufferSetList
default	15:11:21.116466 +0100	kernel	  did not find clientBufferSetList for ID 0x60
default	15:11:21.116467 +0100	kernel	  creating new IOAudioClientBufferSet
default	15:11:21.116468 +0100	kernel	  output
default	15:11:21.116470 +0100	kernel	  !isOnline
default	15:11:21.116471 +0100	kernel	- IOAudioEngineUserClient::registerClientBuffer64() result 0x0
default	15:11:21.116472 +0100	kernel	- IOAudioEngineUserClient::safeRegisterClientBuffer64  returns 0x0
default	15:11:21.116474 +0100	kernel	- IOAudioEngineUserClient::registerBuffer64 0x0 0x110cd7000 0x8010 0x60 returns 0x0
default	15:11:21.116476 +0100	kernel	- IOAudioEngineUserClient::externalMethod returns 0x0
default	15:11:21.116491 +0100	kernel	+ IOAudioEngineUserClient::externalMethod, selector=0x3,   arg0 0x0, arg1 0x0, arg2 0x0 arg3 0x0
default	15:11:21.116493 +0100	kernel	  scalarInputCount=0x0  structureInputSize 0x0, scalarOutputCount 0x0, structureOutputSize 0x0
default	15:11:21.116505 +0100	kernel	+ IOAudioEngineUserClient[<private>]::startClient() - 0
default	15:11:21.116506 +0100	kernel	  audioEngine && !isInactive(). State = 0
default	15:11:21.116507 +0100	kernel	  audioEngine->getState() != kIOAudioEnginePaused
default	15:11:21.116511 +0100	kernel	+- IOAudioEngineUserClient[<private>]::setOnline(1)
default	15:11:21.116511 +0100	kernel	  !isOnline() setting online
default	15:11:21.116513 +0100	kernel	+ IOAudioEngine[<private>]::startClient(<private>)
default	15:11:21.116515 +0100	kernel	+ IOAudioEngine[<private>]::incrementActiveUserClients() - 0
default	15:11:21.116518 +0100	kernel	+ IOAudioEngine[<private>]::startAudioEngine(state = 0)
default	15:11:21.116520 +0100	kernel	+ IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 2 - pending = 2
default	15:11:21.116522 +0100	kernel	- IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 2 - pending = 2 returns 0x0
default	15:11:21.116526 +0100	kernel	+ IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 2 - pending = 2
default	15:11:21.116527 +0100	kernel	- IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 2 - pending = 2 returns 0x0
default	15:11:21.116529 +0100	kernel	+ IOAudioDevice[<private>]::audioEngineStarting() - numRunningAudioEngines = 0
default	15:11:21.116530 +0100	kernel	- IOAudioDevice[<private>]::audioEngineStarting() - numRunningAudioEngines = 1
default	15:11:21.116532 +0100	kernel	+- IOAudioEngine[<private>]::resetStatusBuffer()
default	15:11:21.116667 +0100	kernel	+-IOAudioEngine[<private>]::setState(0x1. oldState=0)
default	15:11:21.116671 +0100	kernel	- IOAudioEngine[<private>]::getTimerInterval()
default	15:11:21.116720 +0100	kernel	- IOAudioEngine[<private>]::startAudioEngine() returns 0x0
default	15:11:21.116722 +0100	kernel	- IOAudioEngine[<private>]::incrementActiveUserClients() - 1 returns 0
default	15:11:21.116725 +0100	kernel	- IOAudioEngine[<private>]::startClient(<private>) returns 0x0
default	15:11:21.116726 +0100	kernel	  engine started
default	15:11:21.116727 +0100	kernel	  bufferSet <private>
default	15:11:21.116728 +0100	kernel	  output clientBuffer <private>
default	15:11:21.116730 +0100	kernel	+ IOAudioStream[<private>]::addClient(<private>)
default	15:11:21.116734 +0100	kernel	- IOAudioStream[<private>]::addClient(<private>) returns 0x0
default	15:11:21.116736 +0100	kernel	- IOAudioEngineUserClient[<private>]::startClient() - 1 returns 0x0
default	15:11:21.116739 +0100	kernel	- IOAudioEngineUserClient::externalMethod returns 0x0
default	15:11:21.152330 +0100	kernel	AGC:: [b2 pid:1192 mux-aware] starting, non-mux-aware app count 0 WS-ready 1 switch-state 0 IG FBs 1 EG FBs 0:0 power-state 6 3D idle HDA idle system-state 1 power-level 20:20 connect-change 0
default	15:11:21.152449 +0100	kernel	AGC:: [b2 pid:1192 non-mux-aware] starting, non-mux-aware app count 1 WS-ready 1 switch-state 0 IG FBs 1 EG FBs 0:0 power-state 6 3D idle HDA idle system-state 1 power-level 20:20 connect-change 0
default	15:11:21.152466 +0100	kernel	AGC::  PEG (usr IGD extdisp 0 WS-ready 1 capture 0 non-mux-aware app 1 ac 0)
default	15:11:21.152479 +0100	kernel	AGC:: Switching from IGD to PEG
default	15:11:21.152505 +0100	kernel	AGC:: :::::::> PEG start powerup [0m 5.902s downtime]
default	15:11:21.301070 +0100	kernel	AGC:: *******> PEG powerup took: 0.148s
default	15:11:21.308746 +0100	trustd	could not enable test hierarchy: no UAT pinning preferences set
default	15:11:21.329415 +0100	kernel	+ IOAudioDevice[<private>]::protectedSetPowerState(1, <private>)
default	15:11:21.329425 +0100	kernel	+ IOAudioDevice[<private>]::initiatePowerStateChange(<private>) - current = 0 - pending = 1
default	15:11:21.441521 +0100	kernel	kPEEnableScreen 1
default	15:11:21.475751 +0100	kernel	Currently unsupported feature requested
default	15:11:21.475794 +0100	kernel	Currently unsupported feature requested
default	15:11:21.475825 +0100	kernel	Currently unsupported feature requested
default	15:11:21.475857 +0100	kernel	Currently unsupported feature requested
default	15:11:21.475898 +0100	kernel	Unsupported Extended capabilities type: 0x100
default	15:11:21.475936 +0100	kernel	Currently unsupported feature requested
default	15:11:21.475971 +0100	kernel	Currently unsupported feature requested
default	15:11:21.476006 +0100	kernel	Currently unsupported feature requested
default	15:11:21.476038 +0100	kernel	Currently unsupported feature requested
default	15:11:21.476077 +0100	kernel	Currently unsupported feature requested
default	15:11:21.476113 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670463 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670516 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670554 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670594 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670645 +0100	kernel	Unsupported Extended capabilities type: 0x100
default	15:11:21.670694 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670739 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670782 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670827 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670870 +0100	kernel	Currently unsupported feature requested
default	15:11:21.670908 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680637 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680678 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680709 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680740 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680780 +0100	kernel	Unsupported Extended capabilities type: 0x100
default	15:11:21.680821 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680858 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680894 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680926 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680961 +0100	kernel	Currently unsupported feature requested
default	15:11:21.680991 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690145 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690186 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690215 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690247 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690287 +0100	kernel	Unsupported Extended capabilities type: 0x100
default	15:11:21.690329 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690365 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690404 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690438 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690472 +0100	kernel	Currently unsupported feature requested
default	15:11:21.690503 +0100	kernel	Currently unsupported feature requested
default	15:11:21.695888 +0100	kernel	AGC:: [pid:129] Sending Event: 1:0
default	15:11:21.695895 +0100	kernel	AGC:: WS SETUP: 0
default	15:11:21.699766 +0100	sharingd	Display changed (ID: 0x4280882, added: YES, removed: NO)
default	15:11:21.699948 +0100	sharingd	Display changed (ID: 0x7BD7F77D, added: NO, removed: YES)
default	15:11:21.714146 +0100	kernel	AGC:: Switch completed, PEG active
default	15:11:21.734181 +0100	kernel	+- IOAudioDevice[<private>]::flushAudioControls()
default	15:11:21.734193 +0100	kernel	+ IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 0 - pending = 2
default	15:11:21.734197 +0100	kernel	- IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 2 - pending = 2 returns 0x0
default	15:11:21.734201 +0100	kernel	+ IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 2 - pending = 2
default	15:11:21.734202 +0100	kernel	- IOAudioDevice[<private>]::protectedCompletePowerStateChange() - current = 2 - pending = 2 returns 0x0
default	15:11:21.734204 +0100	kernel	- IOAudioDevice[<private>]::initiatePowerStateChange(<private>) - current = 2 - pending = 2 returns 0x0
default	15:11:21.734205 +0100	kernel	- IOAudioDevice[<private>]::protectedSetPowerState(1, <private>) returns 0x0
default	15:11:21.857213 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857254 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857285 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857337 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857376 +0100	kernel	Unsupported Extended capabilities type: 0x100
default	15:11:21.857415 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857446 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857481 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857514 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857548 +0100	kernel	Currently unsupported feature requested
default	15:11:21.857589 +0100	kernel	Currently unsupported feature requested
default	15:11:21.858058 +0100	kernel	kPEDisableScreen 1
default	15:11:21.894935 +0100	kernel	kPEEnableScreen 1
default	15:11:22.698236 +0100	kernel	AGC:: WindowServer started pid 129 WS count 3
default	15:11:22.698308 +0100	kernel	AGC:: [WindowServer pid:129 mux-aware] starting, non-mux-aware app count 1 WS-ready 1 switch-state 0 IG FBs 0 EG FBs 1:f power-state 0 3D busy HDA idle system-state 1 power-level 20:20 connect-change 0
default	15:11:22.698366 +0100	kernel	AGC:: [WindowServer pid 129 mux-aware] exiting, non-mux-aware app count 1, runtime: 0:00:00.000
default	15:11:22.698373 +0100	kernel	AGC:: WindowServer died pid 129 WS count 2
default	15:11:24.155913 +0100	kernel	AGC:: mux-regs 5 3 5f 1d 0 8 severity 0 WS-ready 1 switch-state 0 IG FBs 0 EG FBs 1:f power-state 0 3D busy HDA idle system-state 1 power-level 20:20 connect-change 0 : AGC Dump State Timer
default	15:11:24.788485 +0100	com.apple.WebKit.WebContent	Current memory footprint: 34 MB
:!:

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Sun Sep 02, 2018 5:52 pm

I've reproduced it on my work Macbook Pro in High Sierra, same symptoms, including when running in the Xcode debugger. It wasn't quite obvious what was going on during my initial 5 minute poke around, but it runs fine on my own Macbook Pro (Sierra), so hopefully it won't be anything too awful. I will have a closer look at it one night this week.

--Tom
Last edited by tom_seddon on Sun Sep 02, 2018 5:54 pm, edited 1 time in total.

User avatar
guddler
Posts: 536
Joined: Sat Apr 04, 2009 9:43 am
Location: W.Somerset
Contact:

Re: b2 - new emulator

Post by guddler » Sun Sep 02, 2018 6:03 pm

Tom - how do you get a debug window back when you’ve accidentally dragged it outside the bounds of the main window? Is it’s position stored in a file somewhere that can be reset? I didn’t realise the windows were limited to the bounds of the main window and now I’ve lost the 6502 debug window.

Ta.

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Sun Sep 02, 2018 9:40 pm

I thought I'd added a Reset Windows option to the Windows menu, but now I'm actually not sure I did :-| - anyway, you can reset the window positions by looking in ~/Library/Application Support/com.tom-seddon.b2/ (OS X) or %USERPROFILE%/AppData/Local/b2 (Windows) and deleting imgui.ini and imguidock.ini. I think this just will just reset the position and docking/tabbed status of each window, so next you run it you'll just get a pile of windows in the top left corner.

(If you dragged the window off the right or bottom edges, you could also try making the window larger, as I think the window positions are stored window-relative and this can reveal it.)

The docking/tabbing UI is a bit flaky in general, though I"ve found it works well enough when it's working. I probably need to find an alternative.

--Tom
Last edited by tom_seddon on Sun Sep 02, 2018 9:44 pm, edited 1 time in total.

User avatar
guddler
Posts: 536
Joined: Sat Apr 04, 2009 9:43 am
Location: W.Somerset
Contact:

Re: b2 - new emulator

Post by guddler » Sun Sep 02, 2018 9:51 pm

So sorry, yes - it looks like you did indeed add "Reset dock windows" - I just didn't spot it!

Sadly I attempted to move it to the top of my screen, not the right or the bottom :lol:

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Mon Sep 03, 2018 12:22 am

Oh, good, glad to hear it is actually there! I didn't check very carefully, I just had a quick skim through the recent GitHub commits, didn't notice any mention of it, and so figured I might have reverted it, and/or it might still be on my WIP branch...

If you run into one of the docking/tabbing bugs then you'll find it'll come in handy for that as well :-|

--Tom

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Wed Sep 05, 2018 12:25 am

lurkio wrote:
Sun Sep 02, 2018 2:19 pm
Hi. So I updated my clean install of macOS High Sierra (which is on an external hard-drive) with the latest software update from Apple and tried again to download and run the latest release of b2, but I'm getting the same problem I had before on Yosemite -- the b2 app launches, but the window is completely black, and you can't do anything. The only menu bar I can see is the standard Apple menu bar at the top of the screen, with menus named b2, Window, and View.
This appears to be due to graphics switching, at least on my laptop (15" Mid 2014 Macbook Pro i7 + discrete 750M) - things seem to go wrong when the OS switches to the discrete GPU as b2 starts up. A workaround for me is to force the Mac to only use one of the GPU cards, and never switch:

1. plug in external monitor - the system always seems to use the discrete GPU in that case

2. go to System Preferences, Energy, and disable the graphics switching option - another way to force the system to use the discrete GPU

3. use gfxCardStatus to force it to use whichever GPU you want (seems the integrated one can't be used to drive external displays though)

A fix will be forthcoming, if I can figure one out. Hopefully I'm just initialising SDL wrongly or something.

--Tom

P.S. the gfxCardStatus page says its only for 2008-2012 Macs, but it seems to do the job OK on my 15" mid 2014 one...
Last edited by tom_seddon on Wed Sep 05, 2018 1:27 am, edited 2 times in total.

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Wed Sep 05, 2018 12:34 pm

tom_seddon wrote:
Wed Sep 05, 2018 12:25 am
lurkio wrote:
Sun Sep 02, 2018 2:19 pm
the b2 app launches, but the window is completely black, and you can't do anything.
A fix will be forthcoming, if I can figure one out.
Done, and fingers crossed it works for you as well. You can get it from the GitHub releases page: https://github.com/tom-seddon/b2/releases

--Tom
Last edited by tom_seddon on Wed Sep 05, 2018 1:15 pm, edited 1 time in total.

User avatar
Elminster
Posts: 3978
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: b2 - new emulator

Post by Elminster » Wed Sep 05, 2018 12:52 pm

I see my Jenkins is failing to build the sanitizers, will have to look at that later. Not sure if that is related to changes or just a red herring.

Edit: The magic of Jenkins, sorted itself out and rebuilt Docker container. Need to sort Mac out next.
Last edited by Elminster on Wed Sep 05, 2018 1:28 pm, edited 1 time in total.

User avatar
lurkio
Posts: 2210
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: b2 - new emulator

Post by lurkio » Wed Sep 05, 2018 1:06 pm

tom_seddon wrote:
Wed Sep 05, 2018 12:34 pm
tom_seddon wrote:
Wed Sep 05, 2018 12:25 am
lurkio wrote:
Sun Sep 02, 2018 2:19 pm
the b2 app launches, but the window is completely black, and you can't do anything.
A fix will be forthcoming, if I can figure one out.
Done, and fingers crossed it works for you as well. You can get build 20180905-125244-eb24940 (or newer) from the builds site: http://ffe3.com/b2/ci/
Works, thanks! Just tried it on 10.10.5 Yosemite.

Some quick questions: is it right that currently b2 won't emulate a Model B with 8271 floppy controller? Are you planning to add support for it? It might increase compatibility with some games (see bbcmicro.co.uk) because that was probably the most popular config for disc-based Beebs BITD and hence what a lot of games assume will be present?

:?:

User avatar
Elminster
Posts: 3978
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: b2 - new emulator

Post by Elminster » Wed Sep 05, 2018 1:32 pm

I never haad the issue on iMac under HS. But new very still starts okay. Is there anything else new that needs testing?

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Wed Sep 05, 2018 1:57 pm

lurkio wrote:
Wed Sep 05, 2018 1:06 pm
Some quick questions: is it right that currently b2 won't emulate a Model B with 8271 floppy controller? Are you planning to add support for it? It might increase compatibility with some games (see bbcmicro.co.uk) because that was probably the most popular config for disc-based Beebs BITD and hence what a lot of games assume will be present?
At the moment it's 1770 only, but I've never found anything that doesn't work because of it. (That said, a google for '8271 site:bbcmicro.co.uk' finds some notes that the Level 9 adventures need an 8271 DFS to save games.)

Since b2 only supports SSD-type disc images, you're basically restricted to running unprotected stuff anyway, and at this stage all of that (aside from the above) seems to be 1770-friendly. It is on the cards in the long run, along with some support for more in-depth disc formats I should think, although it's lower down the list than some additional emulation stuff like joysticks, Tube, printer, and serial.

--Tom

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Wed Sep 05, 2018 2:06 pm

Elminster wrote:
Wed Sep 05, 2018 1:32 pm
I never haad the issue on iMac under HS. But new very still starts okay. Is there anything else new that needs testing?
If you've been building from GitHub, not really - I haven't been doing much on b2 over the past couple of months.

As for this particular issue, I think it would only have affected you if you've got a Macbook Pro with a discrete GPU, and you start b2 when the Mac happens to be using the integrated GPU. (Something about what b2 does on startup, I don't know what, prods OS X into activating the discrete GPU for it.)

--Tom
Last edited by tom_seddon on Wed Sep 05, 2018 2:07 pm, edited 1 time in total.

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Wed Sep 05, 2018 2:11 pm

As a general update, while I was fiddling around with this, I decided to retire the rolling builds page, and have the CI server always build from the master branch and always make a GitHub release. So up-to-date builds are now available from the GitHub releases page: https://github.com/tom-seddon/b2/releases - just grab the latest one.

--Tom

Coeus
Posts: 1402
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: b2 - new emulator

Post by Coeus » Sat Sep 08, 2018 9:36 pm

Tom,

I remember you saying you added support for non-Acorn 1770-based DFSes to b2. Have you included support for the double density formats offered by most other 1770-based DFSes? If so what did you use as the image format and how do you tell these from SD (10x256 sector/track) SSDs.

This is related to viewtopic.php?f=4&t=15651

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Sun Sep 09, 2018 10:37 pm

Coeus wrote:
Sat Sep 08, 2018 9:36 pm
Tom,

I remember you saying you added support for non-Acorn 1770-based DFSes to b2. Have you included support for the double density formats offered by most other 1770-based DFSes? If so what did you use as the image format and how do you tell these from SD (10x256 sector/track) SSDs.

This is related to viewtopic.php?f=4&t=15651
It does support double density images, but not in .ssd and .dsd files - they're assumed, based on the file extension, to be always single density, 10 sectors per track. (Truncated .ssd/.dsd images are permitted. The disc is just assumed to be 80 tracks, and it's padded internally with sectors full of 0xe5 to make it up to the full size.)

There's a different set of extensions for double density images, which can't be truncated.

There are two disc formats I copied from B-em, apparently intended for ADFS, judging by the names:

.adm - 1 x 80 x 16 (320K)
.adl - 2 x 80 x 16 (640K)

And there's two that BeebEm and B-em don't support to support, so I think I must just have came up with myself when I was working on model-b. The following geometries are supported, with 16- vs 18-sector tracks detected by checking the file size (since truncated images aren't allowed):

.sdd - 1 x 40 x 16 (160K), 1 x 40 x 18 (180K), 1 x 80 x 16 (320K), 1 x 40 x 18 (360K)
.ddd - 2 x 40 x 16 (320K), 2 x 40 x 18 (360K), 2 x 80 x 16 (640K), 2 x 80 x 18 (720K)

b2 treats the disc contents as opaque, so you ought to be able to use .sdd/.ddd for anything - ADFS, DDOS, Watford double-density (which I have to admit I've never tested...), and so on.

--Tom
Last edited by tom_seddon on Sun Sep 09, 2018 10:38 pm, edited 1 time in total.

User avatar
Diminished
Posts: 194
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: b2 - new emulator

Post by Diminished » Thu Sep 13, 2018 1:52 pm

I built this on Linux last night, and it looks very promising. I was able to confirm the veracity of various parts of my Citadel disassembly just by ogling the memory viewer while the game ran.

Is tracing currently broken in the github version? I get the menu option to switch it on and off ("Tracing..."), and the tick symbol appears and disappears upon clicking as I assume it should, but unless I'm being a cretin I don't see any additional dialogue to allow me to save the trace to a file.

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Fri Sep 14, 2018 11:42 pm

Glad you like the emulator, and that you found the debugging stuff useful already :)

(The debugging/hacking/development side of things is probably where I'm going to focus my efforts in the long run, with maybe also a sideline of having a quick way of running games - something like jsbeeb's nice STH integration, perhaps. Realistically, I'm going to struggle to catch up with B-em, BeebEm or MAME in terms of completeness! And I'm only really interested in the ordinary BBC Micro 6502 stuff anyway: BBC B, BBC B+, Master 128, 6502 second processor.)
Diminished wrote:
Thu Sep 13, 2018 1:52 pm
Is tracing currently broken in the github version? I get the menu option to switch it on and off ("Tracing..."), and the tick symbol appears and disappears upon clicking as I assume it should, but unless I'm being a cretin I don't see any additional dialogue to allow me to save the trace to a file.
It should be working. There's supposed to be a dialog that pops up when you click the option... perhaps it could be appearing off the edge of the window or something? I've had a few problems like this with the docking/tabbing UI system I'm using :( Try going to Tools > Reset dock windows > Confirm, to reset the window layout. Does it appear then?

(The tick in the menu indicates that the dialog is visible, rather than that the tracing is active. The tick isn't used entirely consistently: in the Edit menu, it means that the particular option is active/inactive; in the Tools or Debug menu, it means the panel is currently visible (or should be). I do need to do something about this.)

--Tom

Coeus
Posts: 1402
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: b2 - new emulator

Post by Coeus » Fri Sep 14, 2018 11:54 pm

tom_seddon wrote:
Sun Sep 09, 2018 10:37 pm
.adm - 1 x 80 x 16 (320K)
.adl - 2 x 80 x 16 (640K)
That's interesting. Looking back at v2.2 of B-Em it seems to recognise two DD ADFS formats, .adf and .adl with .adf adapting to one of two formats based on the size. The ADFS formats do have letter names, I think so I'll do some more digging here.
tom_seddon wrote:
Sun Sep 09, 2018 10:37 pm
And there's two that BeebEm and B-em don't support to support, so I think I must just have came up with myself when I was working on model-b. The following geometries are supported, with 16- vs 18-sector tracks detected by checking the file size (since truncated images aren't allowed):

.sdd - 1 x 40 x 16 (160K), 1 x 40 x 18 (180K), 1 x 80 x 16 (320K), 1 x 40 x 18 (360K)
.ddd - 2 x 40 x 16 (320K), 2 x 40 x 18 (360K), 2 x 80 x 16 (640K), 2 x 80 x 18 (720K)
Ok, I have adopted these in B-Em for the DD DFS formats used by the non-Acorn DFSes. This is not on master yet.

tom_seddon
Posts: 348
Joined: Mon Aug 29, 2005 11:42 pm
Contact:

Re: b2 - new emulator

Post by tom_seddon » Sat Sep 15, 2018 2:00 am

Coeus wrote:
Fri Sep 14, 2018 11:54 pm
tom_seddon wrote:
Sun Sep 09, 2018 10:37 pm
.adm - 1 x 80 x 16 (320K)
.adl - 2 x 80 x 16 (640K)
That's interesting. Looking back at v2.2 of B-Em it seems to recognise two DD ADFS formats, .adf and .adl with .adf adapting to one of two formats based on the size. The ADFS formats do have letter names, I think so I'll do some more digging here.
Maybe I just made this bit up too, then? Checking the B-em changelog against the model-b changelog, it looks like that could have been the case, as model-b got double density disc image support in Nov 2003 - and presumably ADFS was part of that? - and B-em added support in Jan 2004. But I really don't remember :(

Either way, it looks like .adm files do exist, and are used for 8-bit stuff, though whether anybody uses them any more is another matter.

Example of 320K .adm file: http://www.8bs.com/pool/eug/eug0a.zip (http://8bs.com/catalogue.htm, Electron User Group Disc 0)

Example of truncated .adm file (which my stuff doesn't support - though maybe it should?): http://www.8bs.com/pool/eud/eud84-01.zip (http://8bs.com/catalogue.htm, Electron User #4 Vol 1 No 4)

Is .adf ever used for 8-bit stuff? The 8bs archive sems to only use it for Arc stuff only, which is out of scope for b2, but if it's ever used as an 8-bit format then I'll add it in :)

--Tom

Coeus
Posts: 1402
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: b2 - new emulator

Post by Coeus » Sat Sep 15, 2018 12:23 pm

Thanks for the links - I'll try them as test cases.
tom_seddon wrote:
Sat Sep 15, 2018 2:00 am
Is .adf ever used for 8-bit stuff? The 8bs archive sems to only use it for Arc stuff only, which is out of scope for b2, but if it's ever used as an 8-bit format then I'll add it in :)
I dug out the descriptions from JGH'S MDFS site:

Code: Select all

Small ADFS floppy disks are formatted to:
  ADFS-S: 1 side, 40 tracks, 16 sectors, 256 bytes = 160K old map, old dir
  ADFS-M: 1 side, 80 tracks, 16 sectors, 256 bytes = 320K old map, old dir
  ADFS-L: 2 sides, 80 tracks, 16 sectors, 256 bytes = 640K old map, old dir
and:

Code: Select all

Large ADFS floppy disks are formatted to:
  ADFS-D: 80 tracks, 2 sides, 5 sectors, 1024 bytes = 800K old map, new dir
  ADFS-E: 80 tracks, 2 sides, 5 sectors, 1024 bytes = 800K new map, new dir
  ADFS-F: 80 tracks, 2 sides, 10 sectors, 1024 bytes = 1600K new map, new dir
  ADFS-G: 80 tracks, 2 sides, 20 sectors, 1024 bytes = 3200K new map, new dir
so immediately there seems to be some confusion as what B-Em 2.2 understands a .adf file to be has nothing to do with ADFS-F format in the above tables but instead maps to either ADFS-M if it is <= 700k in size, or ADFS-D/ADFS-E if it is > 700k. As such, I think .adf is just short for ADFS.

Working with floppy disk images seems fraught with trouble. There is the ambiguity of these headerless files and even with files formats that do include some geometry information there are plenty of different formats each more in favour with a particular community that others, rather than a nice common, open standard. See http://www.seasip.info/Unix/LibDsk/index.html for a library that deals with a long list of formats.

User avatar
Pernod
Posts: 1718
Joined: Fri Jun 08, 2012 10:01 pm
Location: Croydon, UK
Contact:

Re: b2 - new emulator

Post by Pernod » Sat Sep 15, 2018 2:40 pm

Coeus wrote:
Sat Sep 15, 2018 12:23 pm
I dug out the descriptions from JGH'S MDFS site:

Code: Select all

Small ADFS floppy disks are formatted to:
  ADFS-S: 1 side, 40 tracks, 16 sectors, 256 bytes = 160K old map, old dir
  ADFS-M: 1 side, 80 tracks, 16 sectors, 256 bytes = 320K old map, old dir
  ADFS-L: 2 sides, 80 tracks, 16 sectors, 256 bytes = 640K old map, old dir
These are OldMap and generally have extensions ads, adm, adl. There are a number of ads images for the Prodest PC 128S at http://hierax.altervista.org/prodest/adfs.htm. The majority of Electron ADFS images use the adf extension instead of adm.
Coeus wrote:
Sat Sep 15, 2018 12:23 pm

Code: Select all

Large ADFS floppy disks are formatted to:
  ADFS-D: 80 tracks, 2 sides, 5 sectors, 1024 bytes = 800K old map, new dir
  ADFS-E: 80 tracks, 2 sides, 5 sectors, 1024 bytes = 800K new map, new dir
  ADFS-F: 80 tracks, 2 sides, 10 sectors, 1024 bytes = 1600K new map, new dir
  ADFS-G: 80 tracks, 2 sides, 20 sectors, 1024 bytes = 3200K new map, new dir
Ignore these, they are all NewMap handled by Archimedes only.

In MAME we don't use the file extension to identify image formats, we have to examine the size and contents to make a 'best guess'. For DFS images I examine the sector counts in the catalogue and compare with size, with special cases for Acorn CP/M and Torch CPN discs. For ADFS I again check for valid sector counts and also the OldMap identifier 'Hugo'. You can see what I do at https://github.com/mamedev/mame/blob/ma ... rn_dsk.cpp.
- Nigel

BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.

User avatar
Diminished
Posts: 194
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: b2 - new emulator

Post by Diminished » Sun Sep 23, 2018 8:24 pm

tom_seddon wrote:
Fri Sep 14, 2018 11:42 pm
It should be working. There's supposed to be a dialog that pops up when you click the option... perhaps it could be appearing off the edge of the window or something? I've had a few problems like this with the docking/tabbing UI system I'm using :( Try going to Tools > Reset dock windows > Confirm, to reset the window layout. Does it appear then?
That got it, thanks.

Post Reply