Latest version of BeebEm

discuss bbc micro and electron emulators (including mame) here!
Coeus
Posts: 3557
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: Latest version of BeebEm

Post by Coeus »

tricky wrote: Sat Feb 13, 2021 10:35 pm They are the MID manufacturers ID and PID product ID. As far as I know they come from the driver and have remained constant for the years that I have been using them.
Assuming these are attached via USB then that sounds like the scheme where the ID is actually embedded in the device and is also almost identical to the scheme used for PCI devices to load the correct driver.

So where I am much less confident that numerical IDs will remain stable are when they are small integer numbers that presumably refer to the nth joystick the OS knows about.
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Latest version of BeebEm

Post by tricky »

Here are a couple of quick tweaks for the current head (410 commints).

beebwin.cpp line 1617

Code: Select all

		case MM_JOY1BUTTONDOWN:
		case MM_JOY1BUTTONUP:
			JoystickButton[0] = (uParam & (JOY_BUTTON1 | JOY_BUTTON3)) != 0;
			JoystickButton[1] = (uParam & (JOY_BUTTON2 | JOY_BUTTON4)) != 0;
Instead of buttons 1 & 2 being fire 1, make buttons 1 & 3 be fire 1 and buttons 2 & 4 be fire 2, until a new joystick system is in.

beebwinprefs.cpp line 55

Code: Select all

#if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900
#  define snprintf _snprintf
#endif
Makes it compile on 2013 (I didn't have 2015 toolset handy) - obviously not really needed.

There are a lot of warnings on VS ;)
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Latest version of BeebEm

Post by chrisn »

tricky wrote: Sat Feb 20, 2021 9:11 am Here are a couple of quick tweaks for the current head (410 commints).

beebwin.cpp line 1617

Code: Select all

		case MM_JOY1BUTTONDOWN:
		case MM_JOY1BUTTONUP:
			JoystickButton[0] = (uParam & (JOY_BUTTON1 | JOY_BUTTON3)) != 0;
			JoystickButton[1] = (uParam & (JOY_BUTTON2 | JOY_BUTTON4)) != 0;
Instead of buttons 1 & 2 being fire 1, make buttons 1 & 3 be fire 1 and buttons 2 & 4 be fire 2, until a new joystick system is in.
Thanks! I'll give this a try, but as you've seen monkeyman79 is working on updating the joystick input with better configuration and keyboard mapping.
tricky wrote: Sat Feb 20, 2021 9:11 am beebwinprefs.cpp line 55

Code: Select all

#if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900
#  define snprintf _snprintf
#endif
Makes it compile on 2013 (I didn't have 2015 toolset handy) - obviously not really needed.

There are a lot of warnings on VS ;)
I fixed this by replacing the snprintf calls with sprintf. I'd recommend upgrading to VS2019 though, we're starting to make more use of modern C++ features, and I'm not sure what is supported in 2013. We can review that though, if it starts causing you problems.
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Latest version of BeebEm

Post by tricky »

The first joystick enumerated under windows is the one set as the preferred device in "Game Controllers"/"Setup USB game controllers".
I don't know if your new joystick setup is bothered about setting different configurations for multiple identical controllers, but you might want to make sure that it isn't "broken".
e.g. If you set the first controller to fire 1 and adval 0,1 and then the second to fire 2 and adval 3,4. If they are save only against MID+PID, when you reload, you may have two sticks both mapped to fire 1 and adval 1,2. My solution was to define controls for when it is the first controller and then swap them (fire 1<->2 and adval 1+2<->3+4) when not.
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Latest version of BeebEm

Post by leenew »

Hi,
I would like to add a feature request to BeebEm please :wink:
How easy would it be for BeebEm to emulate a Model A?
Probably a Model A running BASIC 1 and/or OS 0.1?
I think the switching between 16K and 32K may be less important but would be nice if it was included, as would the switching on/off of the user 6522 VIA.
We have a few old games in the archive that were written for early beebs and rely on the behaviour of OS 0.1 and maybe BASIC 1 too.
We have tweaked these to work with BASIC 2 and OS 1.2 but it would be good to see the game operating properly in the environment for which it was written.
At least we could then see if our tweaks were correct!
The most common problems were incorrect user-defined graphics being displayed, and, because of a change of behaviour with VDU4 and VDU5, the games sometimes did not display properly at all.

Thanks in advance,

Lee.
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Latest version of BeebEm

Post by FourthStone »

I would like to suggest improvements to key handling for user defined key mappings.

When ever I remap certain keys, mostly for games that use Z X ? *, BeebEm appears to always press SHIFT when using the up / down remapped keys so if the game uses SHIFT for a specific action it will always trigger when pressing certain remapped keys. e.g. ? & * (remapped to W S).

Let me know if this description is not clear or needs further clarification, maybe it's just me that sees this behavior? When I do get the above condition I tend to jump over to B-Em as it seems to handle remapping SHIFT and other keys a little better.
guesser
Posts: 708
Joined: Mon Jun 26, 2006 10:21 pm
Contact:

Re: Latest version of BeebEm

Post by guesser »

Because those are all shifted keys shirley. If you don't want shift you need to remap : instead of * for example I would think?
Various teletext things including a web based teletext editor which can export as mode 7 screens.
Join the Teletext Discord for teletext chat.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Latest version of BeebEm

Post by lurkio »

Yes, quite often the instructions for a Beeb game will say that it uses the asterisk key (*) when in fact what it uses is technically the colon key (:) which is just the unShifted form of the same key.

(This has caused endless confusion for people trying to play games in-browser on bbcmicro.co.uk, several of whom have contacted us to complain that the Up key for a particular game is in an unreachable or impractical place on their PC keyboard! They hadn't realised that what they wanted was the Beeb's colon key, which JSBeeb maps to the single-quote key on modern PC keyboards! The confusion is understandable.)

I think that the reason why so many Beeb games' instructions back in the day said "asterisk" when they meant "colon" is just that the asterisk symbol was more distinctive and hence easier for newbies to locate on the physical keyboard in front of them!

:idea:
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Latest version of BeebEm

Post by tricky »

Thanks for pointing that out, I have also seen many complaints but never realised that the cause was asterix vs color description of the key!
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Latest version of BeebEm

Post by tricky »

Hi chrisn, I can't find where you asked, but here is the code I have in my old hacked beebem for hsync pulse width horizontal position adjustment.

Code: Select all

void AdjustVideo() {
	ActualScreenWidth=CRTC_HorizontalDisplayed*HSyncModifier;
	if (ActualScreenWidth>800) ActualScreenWidth=800;
	if (ActualScreenWidth<640) ActualScreenWidth=640;

	InitialOffset=0-(((CRTC_HorizontalTotal+1)/2)-((HSyncModifier==8)?40:20));
	HStart=2*(InitialOffset+CRTC_HorizontalTotal+1-CRTC_HorizontalSyncPos)-(CRTC_SyncWidth&15)-8;
	HStart+=(HSyncModifier==8)?4:2;
	if (TeletextEnabled) HStart+=4;
//	if (HStart<0) HStart=0;
	ScreenAdjust=(HStart*HSyncModifier)/2+((VScreenAdjust>0)?(VScreenAdjust*800):0);
}
It's the -(CRTC_SyncWidth&15) bit.
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Latest version of BeebEm

Post by chrisn »

Thanks tricky. I'm using Kieran's 6845 Register Browser program to test this out.

I had to put this line back in though as BeebEm crashes with it commented out:

Code: Select all

if (HStart<0) HStart=0;
I can see that your change halves the amount the screen is shifted for each step in R3. But if you increment R3 from 40 to 41, the screen doesn't yet shift to the left.
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Latest version of BeebEm

Post by chrisn »

FourthStone wrote: Wed Mar 24, 2021 9:07 am I would like to suggest improvements to key handling for user defined key mappings.

When ever I remap certain keys, mostly for games that use Z X ? *, BeebEm appears to always press SHIFT when using the up / down remapped keys so if the game uses SHIFT for a specific action it will always trigger when pressing certain remapped keys. e.g. ? & * (remapped to W S).

Let me know if this description is not clear or needs further clarification, maybe it's just me that sees this behavior? When I do get the above condition I tend to jump over to B-Em as it seems to handle remapping SHIFT and other keys a little better.
Can you give an example? I'm not sure I'm seeing the issue... I tried mapping (PC) A -> (Beeb) Z, D -> X, S -> /, W -> :

If I press S and W I get / and :, and pressing Shift+S and Shift+W gives ? and *
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Latest version of BeebEm

Post by chrisn »

leenew wrote: Tue Mar 09, 2021 12:49 pm I would like to add a feature request to BeebEm please :wink:
How easy would it be for BeebEm to emulate a Model A?
Probably a Model A running BASIC 1 and/or OS 0.1?
I'd like for BeebEm to emulate the model A. For when I get to it... which games could I try this out with?
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Latest version of BeebEm

Post by FourthStone »

chrisn wrote: Mon Mar 29, 2021 10:06 pm Can you give an example? I'm not sure I'm seeing the issue... I tried mapping (PC) A -> (Beeb) Z, D -> X, S -> /, W -> :

If I press S and W I get / and :, and pressing Shift+S and Shift+W gives ? and *
I tried to produce an example for myself and I am starting to think it is on my end, for some reason the 'default' keyboard layout maps ?* to my `~ key.

I'll reinstall to a different folder and compare the keyboard layout files and let you know.

When I remap `~ to something else then the Shift key behaves itself... I'll dig deeper :-k
guesser
Posts: 708
Joined: Mon Jun 26, 2006 10:21 pm
Contact:

Re: Latest version of BeebEm

Post by guesser »

Oh the joys of different international keyboard layouts #-o

Your ~ is presumably to the left of 1 like a US keyboard, and a wide enter/return key I guess?
Various teletext things including a web based teletext editor which can export as mode 7 screens.
Join the Teletext Discord for teletext chat.
User avatar
FourthStone
Posts: 1527
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Latest version of BeebEm

Post by FourthStone »

guesser wrote: Tue Mar 30, 2021 12:16 am Oh the joys of different international keyboard layouts #-o

Your ~ is presumably to the left of 1 like a US keyboard, and a wide enter/return key I guess?
Well that would explain it then, being in Australia we tend to get the US layout and I never really considered this before, which is surprising as I have been putting up with the quirky behaviour in BeebEm all this time thinking it was a bug #-o

So looking through the help information I notice there is a US logical layout file, I'll try this and see how it goes, apologies I never thought to read the manual [-X ](*,) :-
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: Latest version of BeebEm

Post by lovebug »

i noticed on the beebem im running (4.16 on windows) that the vertical screen rendering is off by 1 count in windowed and fullscreen modes

my laptop screen is 1366x768 so the bbc's 256 lines should render perfectly into the 768 line display with 3 screen pixels to 1 beeb pixel but I have found that its rendering to 767 lines not 768 which causes a thinner line on screen towards the bottom

its a simple fix and I would have a go at fixing it myself if I could get it to compile in codeblocks 8
Image Image Image Image
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Latest version of BeebEm

Post by tricky »

chrisn wrote: Mon Mar 29, 2021 9:52 pm Thanks tricky. I'm using Kieran's 6845 Register Browser program to test this out.

I had to put this line back in though as BeebEm crashes with it commented out:

Code: Select all

if (HStart<0) HStart=0;
I can see that your change halves the amount the screen is shifted for each step in R3. But if you increment R3 from 40 to 41, the screen doesn't yet shift to the left.
Looks like I was also in:

Code: Select all

void doHorizLine(unsigned long Col, int y, int sx, int width) {
	if (TeletextEnabled) y/=TeletextStyle;
	int left = sx+ScreenAdjust+(TeletextEnabled?36:0);
	if (left > 800) return;
	if (left < 0)
	{
		width += left;
		left = 0;
	}
	if (left + width > 800)
	{
		width = 800 - left;
	}
	int d = (y*800)+left;
//	int d = (y*800)+sx+ScreenAdjust+(TeletextEnabled?36:0);
	if (width <= 0 || (d+width)>(500*800)) return;
	if (d<0) return;
	memset(m_screen+d, Col, width);
};
Sorry for not having these changes as one lot, but I gave up ages ago on any of my changes being needed again and stopped doing feature changelists for it.
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Latest version of BeebEm

Post by leenew »

leenew wrote: Tue Mar 09, 2021 12:49 pm Hi,
I would like to add a feature request to BeebEm please :wink:
How easy would it be for BeebEm to emulate a Model A?
Probably a Model A running BASIC 1 and/or OS 0.1?
I think the switching between 16K and 32K may be less important but would be nice if it was included, as would the switching on/off of the user 6522 VIA.
We have a few old games in the archive that were written for early beebs and rely on the behaviour of OS 0.1 and maybe BASIC 1 too.
We have tweaked these to work with BASIC 2 and OS 1.2 but it would be good to see the game operating properly in the environment for which it was written.
At least we could then see if our tweaks were correct!
The most common problems were incorrect user-defined graphics being displayed, and, because of a change of behaviour with VDU4 and VDU5, the games sometimes did not display properly at all.

Thanks in advance,

Lee.
Hi,
It is very early games that are problematic.
Things like these: viewtopic.php?f=32&t=7700&p=93682&hilit ... 982#p93682

They had to be tweaked to work properly.
The games woruld be expecting some combination of BASIC 1 and OS 0.1.
I think proper emulation of these 2 things would be the most helpful.
We would then know how the games should look, so we would be certain our tweaks were correct.
Whether 32K or just having 1 x 6522 installed would make any difference, I don't know.

** Although I recall Defender and maybe Pacman from Acornsoft did not work properly without both 6522s installed.

EDIT: ADDED SOME CANDIDATES BELOW THAT SHOULD WORK ON OS 0.1
OS 0.1 games.zip
(53.99 KiB) Downloaded 49 times
Thanks

Lee
Last edited by leenew on Tue Mar 30, 2021 3:29 pm, edited 1 time in total.
User avatar
leenew
Posts: 4900
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Latest version of BeebEm

Post by leenew »

It would also be good if the teletext bug that corrupts the player in this game: http://bbcmicro.co.uk/game.php?id=1310 could be fixed :D

Lee
mad
Posts: 60
Joined: Wed Dec 02, 2020 10:12 am
Contact:

Re: Latest version of BeebEm

Post by mad »

Hello,

Could someone please compile the latest BeebEm source for me?.
Windows x86 (Win7)

Thanks!
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Latest version of BeebEm

Post by chrisn »

You can get the latest release version here: https://github.com/stardot/beebem-windo ... bEm416.exe

Or do you want to try out the current development build? (I'm slowly working towards a 4.17 release)
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
mad
Posts: 60
Joined: Wed Dec 02, 2020 10:12 am
Contact:

Re: Latest version of BeebEm

Post by mad »

Hi Chris,

Yes, It's the latest development build i am after.

good luck with 4.17 release, i can't wait. :D
Zalaga
Posts: 14
Joined: Thu Mar 18, 2021 4:22 pm
Contact:

Re: Latest version of BeebEm

Post by Zalaga »

Sorry for the newbie question

Thought I would have a go at compiling beebem on my windows 10 pc, I followed instructions to the letter in the readme file.

I can't get it to compile, looking at the error the main error is it cannot find windows.h

Now I noticed Windows SDK version was set to 8.1 but this is not available as an option in the Visual Studio 2019 installer. I have subsequently found an installer for Windows SDK 8.1 and have it installed with all features selelcted

I also did manual search for windows.h, I can't find it

I am using Visual Studio 2019 Community edition, I can program in C, but C# is main language I have used

I have trawled through the answers I could find on stack overflow regarding this issue

I have gone in to the additional directories property and edited the library path to find out what it evaluates too, it seems to be ok. There was a prompt when I opened the project which asked me which version of windows sdk I wanted to re-target, I left it at 8.1.

If anyone could shed some light on to the problem please, would be most appreciated, thanks
guesser
Posts: 708
Joined: Mon Jun 26, 2006 10:21 pm
Contact:

Re: Latest version of BeebEm

Post by guesser »

To get it to build here I change all the references to

Code: Select all

<PlatformToolset>v140_xp</PlatformToolset>
to

Code: Select all

<PlatformToolset>v140</PlatformToolset>
in the vcxproj files.
Various teletext things including a web based teletext editor which can export as mode 7 screens.
Join the Teletext Discord for teletext chat.
User avatar
tricky
Posts: 7694
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Latest version of BeebEm

Post by tricky »

I don't remember changing that, but VS2019 has a million install options!
guesser
Posts: 708
Joined: Mon Jun 26, 2006 10:21 pm
Contact:

Re: Latest version of BeebEm

Post by guesser »

I think when I was on Windows 7 I'd managed to install the options for doing XP builds somehow, but when I set up the build tools on this Windows 10 I couldn't find the option and decided I'd had enough jumping through hoops to install obsolete libraries.
Various teletext things including a web based teletext editor which can export as mode 7 screens.
Join the Teletext Discord for teletext chat.
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Latest version of BeebEm

Post by chrisn »

There's a couple of optional Visual Studio 2019 components you need to install to get BeebEm to compile:

* MSVC v140 - VS 2015 C++ build tools (v14.00)
* C++ Windows XP Support for VS 2017 (v141) tools [Deprecated]

Also, If you want to build the installer, you'll need Inno Setup 5.6.1.

I could probably drop Windows XP support, but those are the tools I currently use to make published builds.

Sorry that the documentation isn't complete, I'll update it.
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
Zalaga
Posts: 14
Joined: Thu Mar 18, 2021 4:22 pm
Contact:

Re: Latest version of BeebEm

Post by Zalaga »

Hi

Thanks for all the replies and help, I now have a succesful compile of all projects :) , installing the following package seemed to resolve the odd issue with windows.h:

* C++ Windows XP Support for VS 2017 (v141) tools [Deprecated]

So it seems that is needed along with standalone installation of the Windows 8.1 sdk to get it to compile on a vanilla windows 10 pc with Visual Studio 2019 Community edition

Zalaga
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Latest version of BeebEm

Post by chrisn »

I have just released BeebEm 4.17 (for Windows).

You can get it from GitHub here. Hopefully this release will be added to Mike Wyatt's website soon.

Changes:
  • Writes to the sound chip are now allowed while sound is disabled. This ensures that the sound chip is in the right state if sound is later enabled.
  • Fixed sound frequency write. Setting frequency to zero should initalise the counter to 1024.
  • The cursor is now disabled based on CRTC register R8 (see AUG p.366). This fixes the cursor display in Wizzy's Mansion and Pedro.
  • Debugger improvements:
    • Fixed instruction 4B (ALR imm).
    • Set the initial input focus so that you can now open the Debugger window and type commands without having to click in the edit box.
    • Added 'over' command. This steps over a JSR instruction, i.e., runs to the next instruction in memory after the JSR.
    • Added a command to show existing labels.
    • Added a command to clear the output window.
    • Fixed help output to show all commands and aliases.
    • Fixed the 'file' command to allow the full 64k address space to be saved.
    • The following commands now prompt for a filename if not given: labels load, save, file, script.
  • Mouse input improvements:
    • Changed the right mouse button to control joystick button 2, which is useful for games such as Phoenix and Ripcord that use both joystick buttons.
    • Fixed the "Hide Cursor" option, which caused the cursor to flicker when using the mouse-stick options.
    • Added mouse capture option. To enable, select the "Capture Mouse" menu item and click in the window area. To release the mouse, press Ctrl+Alt.
    • Fixed "AMX L+R for Middle" option.
    • Fixed bug where Master 512 mouse input would sometimes be reversed. Master 512 configures interrupt on raising and falling CBx edges alternately. Instead of guessing which should be next, check selected edge in the PCR register.
    • Improved mouse responsiveness when captured.
  • Fixed Mode 7 run-length optimisation in the video renderer
  • Fixed the teletext font file. The 'W' character had one pixel missing.
  • Improved Mode 7 screen capture to avoid distorting the image. Use the 640x512 option for best results.
  • Reset double-height state at start of mode 7 screen. This fixes an issue where, if double height is enabled on the last character row of a mode 7 screen, the top row of the screen would also be treated as double height. This effect could be seen in the Twin Kingdom Valley instructions pages.
  • Fixed Solidisk Sideways RAM emulation. Writes to RAM bank are selected by User VIA output port B even if the bank selected by &FE30 is writable.
  • Fixed Preferences.cfg file backwards compatibility.
  • Fixed reading the tube coprocessor selection from BeebEm 4.14 Preferences.cfg files.
  • Fixed crash when loading multiple ADFS images from the command line.
  • Fixed PrinterEnabled preferences option, which was not being saved/loaded correctly.
  • Added BeebEm.user.props.example file and updated the instructions for how to compile BeebEm.
Thanks to Tadek (@monkeyman79) for your contributions, and everyone who has reported issues or suggested new features to add.

As ever, feedback is welcome, either here or as GitHub issues.
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
Post Reply

Return to “8-bit acorn emulators”