B-Em
Re: B-Em
is there an actual debugger (something like beebem) in b-em as I cant find anything except a popup window that seems to display memory access as colored pixels and a break button that I cannot get to do anything
what am i doing wrong
what am i doing wrong
Re: B-Em
The debugger is command-line in b-em. On Linux it uses the terminal you started b-em from for input/output so you will need to start it from a terminal window, not by double-clicking in a file manager. On Windows it should open a console window for the debugger.
- Diminished
- Posts: 1252
- Joined: Fri Dec 08, 2017 9:47 pm
- Contact:
Re: B-Em
I'm not fortunate enough to be on Apple Silicon, but I checked my configuration script for B-Em on my Intel Mac and it appears that I've encountered this problem before.stevei2791 wrote: ↑Wed Nov 22, 2023 8:01 am Has anyone managed to compile b-em on apple silicon? I'm getting the following message while building
It seems you need to set these environment variables to pass to configure:
Code: Select all
export ac_cv_func_malloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes
./autogen.sh
./configure
-
- Posts: 92
- Joined: Sat Aug 29, 2015 1:21 pm
- Location: Irchester
- Contact:
Re: B-Em
thank you, with your help I've manage to build it.
Re: B-Em
I started adding one locally but haven't finished it.
-
- Posts: 92
- Joined: Sat Aug 29, 2015 1:21 pm
- Location: Irchester
- Contact:
Re: B-Em
After managing to build the executable it would not run because it couldn't find the dynamic library using @rpath, after a lot of searching I've found that there is currently a problem between gcc (home-brew) and Xcode 15.
To fix it you need to change the library paths in the executable post compile/link - note you will get errors about duplicate libraries being ignored when you build.
I created this script to change the old path in the executable to the new path (my allegro5 libs are in /usr/local/lib)
Code: Select all
# using otool -l b-em
# change any dynamic libraries with @rpath to use full path/filename
# workaround for problems between homebrew and Xcode 15
install_name_tool -change @rpath/liballegro_audio.5.2.dylib /usr/local/lib/liballegro_audio.5.2.dylib b-em
install_name_tool -change @rpath/liballegro_acodec.5.2.dylib /usr/local/lib/liballegro_acodec.5.2.dylib b-em
install_name_tool -change @rpath/liballegro_primitives.5.2.dylib /usr/local/lib/liballegro_primitives.5.2.dylib b-em
install_name_tool -change @rpath/liballegro_dialog.5.2.dylib /usr/local/lib/liballegro_dialog.5.2.dylib b-em
install_name_tool -change @rpath/liballegro_image.5.2.dylib /usr/local/lib/liballegro_image.5.2.dylib b-em
install_name_tool -change @rpath/liballegro_font.5.2.dylib /usr/local/lib/liballegro_font.5.2.dylib b-em
install_name_tool -change @rpath/liballegro_main.5.2.dylib /usr/local/lib/liballegro_main.5.2.dylib b-em
install_name_tool -change @rpath/liballegro.5.2.dylib /usr/local/lib/liballegro.5.2.dylib b-em
[]code]
-
- Posts: 574
- Joined: Fri Apr 13, 2018 2:48 pm
- Contact:
Re: B-Em
I’m pretty certain there is because I recall using it to debug various problems in my code a few years ago. I think this would have been using a Windows build of B-Em though.
The B-em GitHub page suggests you can select “debug” or “debugger” from one of the menus and you should get a text window into which you can type debug commands.
- TobyLobster
- Posts: 622
- Joined: Sat Aug 31, 2019 7:58 am
- Contact:
Re: B-Em
I'm on Mac: If you start b-em from the terminal, when you click the 'Break' menu option the emulation stops and you get a prompt in the terminal. You have to tick the Debugger menu option first.VectorEyes wrote: ↑Wed Nov 22, 2023 11:19 pmI’m pretty certain there is because I recall using it to debug various problems in my code a few years ago. I think this would have been using a Windows build of B-Em though.
'?' gives you options in the debugger.
Re: B-Em
Thanks, I knew I was missing somethingCoeus wrote: ↑Wed Nov 22, 2023 12:40 pm The debugger is command-line in b-em. On Linux it uses the terminal you started b-em from for input/output so you will need to start it from a terminal window, not by double-clicking in a file manager. On Windows it should open a console window for the debugger.
- Diminished
- Posts: 1252
- Joined: Fri Dec 08, 2017 9:47 pm
- Contact:
Re: B-Em
I am hoping that all the new tape code is now written, and all that remains is testing and the odd bug fix.
(This may be naïve.)
I really wish it wasn't necessary to have an actual "Record" checkbox to enable writing to tape. You would think that you could enable recording based on whether the tape system is currently generating leader tone or not. However, certain protected tape loaders do generate leader tone during loading, so this won't work. :(
(This may be naïve.)
I really wish it wasn't necessary to have an actual "Record" checkbox to enable writing to tape. You would think that you could enable recording based on whether the tape system is currently generating leader tone or not. However, certain protected tape loaders do generate leader tone during loading, so this won't work. :(
Re: B-Em
one thing I've noticed with b-em is that the screen update seems to be at 25Hz
I've tried all the video settings but cannot get the screen to update at 50Hz
to test this I used this but instead of getting a flashing display I get a solid color
if I change the two FX commands to 2 frames instead of 1 then I see a flashing screen
its annoying because any programs (games) that use 50Hz smooth animation look jerky at 25Hz
is this a b-em issue or my laptop ?
I've tried all the video settings but cannot get the screen to update at 50Hz
to test this I used this but instead of getting a flashing display I get a solid color
Code: Select all
MODE 0
VDU 19,0,11;0;
*FX 9,1
*FX 10,1
its annoying because any programs (games) that use 50Hz smooth animation look jerky at 25Hz
is this a b-em issue or my laptop ?
- TobyLobster
- Posts: 622
- Joined: Sat Aug 31, 2019 7:58 am
- Contact:
Re: B-Em
Works fine for me, it flashes away like crazy. I have 'B-em v-4a1792f' on Mac, so not the latest.
Re: B-Em
lovebug wrote: ↑Wed Nov 29, 2023 10:22 am to test this I used this but instead of getting a flashing display I get a solid colorCode: Select all
MODE 0 VDU 19,0,11;0; *FX 9,1 *FX 10,1
Typing in the four commands above, I'm seeing a non flashing screen with a fairly recent B-Em v98830d1 running on Windows 10. On BeebEm I get a flashing display when I type in the same commands.
Re: B-Em
Thanks. Major fail. And by design, apparently. I cannot imagine why.
- Diminished
- Posts: 1252
- Joined: Fri Dec 08, 2017 9:47 pm
- Contact:
Re: B-Em
Flashes fine on a Mac here also (snapshot from 20th October). May be an Allegro-on-Windows problem.TobyLobster wrote: ↑Wed Nov 29, 2023 11:28 am Works fine for me, it flashes away like crazy. I have 'B-em v-4a1792f' on Mac, so not the latest.
Feel free to teach us lesser mortals a lesson by fixing the problem yourself and submitting a patch.
Re: B-Em
Some LCDs do that for you, there have been a few posts about a great way to extend the palette!
Wouldn't surprise me if newer windows has added something behind the scenes, possibly as a power saving mode on laptops!
Wouldn't surprise me if newer windows has added something behind the scenes, possibly as a power saving mode on laptops!
Re: B-Em
It does seem to be b-em. In main.c there is this table:
Code: Select all
const emu_speed_t emu_speeds[NUM_EMU_SPEEDS] = {
{ "10%", 1.0 / (50.0 * 0.10), 1 },
{ "25%", 1.0 / (50.0 * 0.25), 1 },
{ "50%", 1.0 / (50.0 * 0.50), 1 },
{ "75%", 1.0 / (50.0 * 0.75), 1 },
{ "100%", 1.0 / 50.0, 2 },
{ "150%", 1.0 / (50.0 * 1.50), 2 },
{ "200%", 1.0 / (50.0 * 2.00), 2 },
{ "300%", 1.0 / (50.0 * 3.00), 3 },
{ "400%", 1.0 / (50.0 * 4.00), 4 },
{ "500%", 1.0 / (50.0 * 5.00), 5 }
};
Re: B-Em
I compiled B-em v-a55f951 and its running on
Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Intel Core i5-4210U Speed (MHz) min/max: 800/2700
Intel Haswell-ULT Integrated Graphics
Screen: 1366x768 s-dpi: 96
Is the issue my laptop ?
--- edit ---
oh right sorry I just read your post after posting, the 100% entry is set to 2 frames
i'll change it to 1 and recompile
maybe auto frame skip would be a better idea ?
Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Intel Core i5-4210U Speed (MHz) min/max: 800/2700
Intel Haswell-ULT Integrated Graphics
Screen: 1366x768 s-dpi: 96
Is the issue my laptop ?
--- edit ---
oh right sorry I just read your post after posting, the 100% entry is set to 2 frames
i'll change it to 1 and recompile
maybe auto frame skip would be a better idea ?
Re: B-Em
ok that quick fix of changing the 100% entry from 2 frames to 1 has caused some strange side effects that only affect full screen mode
if I switch to mode 0 type something on screen then switch to mode 7 then I see is mode 7 characters on one of the frames (odd?) and mode 0 graphics on the other frame (even?), in windowed mode everything seems to be normal
I might pile another hack on top of the hack to use 2 frames when teletext is enabled and 1 frame when not
But really this is the wrong thing to do
Even in full screen mode the graphics modes only look ok when display type is set to line doubling, all other modes flicker badly when 100% is set to 1 frame
if I switch to mode 0 type something on screen then switch to mode 7 then I see is mode 7 characters on one of the frames (odd?) and mode 0 graphics on the other frame (even?), in windowed mode everything seems to be normal
I might pile another hack on top of the hack to use 2 frames when teletext is enabled and 1 frame when not
But really this is the wrong thing to do
Even in full screen mode the graphics modes only look ok when display type is set to line doubling, all other modes flicker badly when 100% is set to 1 frame
Re: B-Em
That's looking good. Look forward to having a play around with it.Diminished wrote: ↑Wed Nov 29, 2023 1:07 am I am hoping that all the new tape code is now written, and all that remains is testing and the odd bug fix.
I really wish it wasn't necessary to have an actual "Record" checkbox to enable writing to tape. You would think that you could enable recording based on whether the tape system is currently generating leader tone or not. However, certain protected tape loaders do generate leader tone during loading, so this won't work.
- Diminished
- Posts: 1252
- Joined: Fri Dec 08, 2017 9:47 pm
- Contact:
Re: B-Em
I've thought about this a bit.Coeus wrote: ↑Sun Oct 22, 2023 11:57 am There is almost certainly more that could be done to make automated tests easier. B-Em cannot, at the moment at least, be scripted to say "load tape file xxx" in the middle of a session. It can take the name of a tape file on the command line. There are some pieces that could prove useful, though.
... snip ...
For the tape reading tests, I think automation can be achieved with a couple of simple patches:
- a) adding a command-line switch (or debugger command) which will cause B-Em to shut down with a non-zero error code when a breakpoint (or watchpoint, etc.) is hit in the debugger. I would suggest that taking the breakpoint number, ORing it with (say) 0x40000000, and using that as the return code would be good enough here.
It appears that main() always returns 0 currently (although maybe there are some exit() calls dotted around as well) ...
... so a general mechanism will be needed for quitting with an error code. I don't know if you have any preference for how this should be done. A global variable would be simplest (although I have a pathological aversion to these).Code: Select all
int main(int argc, char **argv) { main_init(argc, argv); main_run(); main_close(); return 0; }
This mechanism (setting up some breakpoints/watchpoints in the debugger and exiting with per-breakpoint error codes if they are hit) could most likely be used for an extremely wide variety of automated tests.
- b) adding a new breakpoint type which will break into the debugger when the loaded tape ends. This is likely to be needed so that the emulator can be made to shut down reliably if the end of a test tape is reached without any other breakpoint being hit.
- Rich Talbot-Watkins
- Posts: 2054
- Joined: Thu Jan 13, 2005 5:20 pm
- Location: Palma, Mallorca
- Contact:
Re: B-Em
This seems to have been introduced by commit cc93741, I assume by mistake.Coeus wrote: ↑Wed Nov 29, 2023 6:45 pm It does seem to be b-em. In main.c there is this table:The last number in each entry determines how many frames are displayed. 1 means display every frame, 2 is every second frame etc. I assume these numbers were set by some trial and error but what is realistic would depend on the system b-em is running on. If I change the entry for 100% to 1 then your test cases flashes correctly.Code: Select all
const emu_speed_t emu_speeds[NUM_EMU_SPEEDS] = { { "10%", 1.0 / (50.0 * 0.10), 1 }, { "25%", 1.0 / (50.0 * 0.25), 1 }, { "50%", 1.0 / (50.0 * 0.50), 1 }, { "75%", 1.0 / (50.0 * 0.75), 1 }, { "100%", 1.0 / 50.0, 2 }, { "150%", 1.0 / (50.0 * 1.50), 2 }, { "200%", 1.0 / (50.0 * 2.00), 2 }, { "300%", 1.0 / (50.0 * 3.00), 3 }, { "400%", 1.0 / (50.0 * 4.00), 4 }, { "500%", 1.0 / (50.0 * 5.00), 5 } };
Re: B-Em
sorry I was wrong, it is my toshiba laptop causing display issues
I just made the same modification on my imac changing the 100% entry to 1 frame and it works fine
system details:
Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Desktop System: Apple product: iMac14,3
Intel Core i5-4570S (MHz) min/max: 800/3600
NVIDIA GK107M [GeForce GT 750M Mac Edition]
Screen-1: 0 s-res: 1920x1080 s-dpi: 96
working fine
I just made the same modification on my imac changing the 100% entry to 1 frame and it works fine
system details:
Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Desktop System: Apple product: iMac14,3
Intel Core i5-4570S (MHz) min/max: 800/3600
NVIDIA GK107M [GeForce GT 750M Mac Edition]
Screen-1: 0 s-res: 1920x1080 s-dpi: 96
working fine
Code: Select all
const emu_speed_t emu_speeds[NUM_EMU_SPEEDS] = {
{ "10%", 1.0 / (50.0 * 0.10), 1 },
{ "25%", 1.0 / (50.0 * 0.25), 1 },
{ "50%", 1.0 / (50.0 * 0.50), 1 },
{ "75%", 1.0 / (50.0 * 0.75), 1 },
{ "100%", 1.0 / (50.0 * 1.00), 1 },
{ "150%", 1.0 / (50.0 * 1.50), 2 },
{ "200%", 1.0 / (50.0 * 2.00), 2 },
{ "300%", 1.0 / (50.0 * 3.00), 3 },
{ "400%", 1.0 / (50.0 * 4.00), 4 },
{ "500%", 1.0 / (50.0 * 5.00), 5 }
};
Last edited by lovebug on Fri Dec 01, 2023 12:56 am, edited 1 time in total.
Re: B-Em
That looks a merge of my pull request for the ARM7 co-pro. I can confirm that changing that was a mistake and should be put back to 1. My apologies.Rich Talbot-Watkins wrote: ↑Thu Nov 30, 2023 6:06 pm This seems to have been introduced by commit cc93741, I assume by mistake.
Re: B-Em
That does seem completely unrelated with the rest of that merge request. I have push a commit to revert that one line to 1.
Re: B-Em
Hi all.
I got no issues with joysticks ( if the game supports joysticks ) But what I want to do is map keys to the joystick.
I have a GPD Win2 and I`d love to get a BBC emulator working. I can`t seem to find one that allows this.
Thanks
I got no issues with joysticks ( if the game supports joysticks ) But what I want to do is map keys to the joystick.
I have a GPD Win2 and I`d love to get a BBC emulator working. I can`t seem to find one that allows this.
Thanks
Re: B-Em
The limits versions of beebem and b-em often last behind windows and I don't know if the others have that facility, maybe try b2.
Re: B-Em
Was that meant to be "The Linux versions of beebem and b-em often lag behind the Windows versions..."? If, so, I agree with BeebEm because the latest version is a Windows-only application and the Linux version is a separate fork but b-em is multi-platform.
But then the Win2 can run either Windows or Linux and, by default, runs Windows anyway.
To answer the original question, I did add some support to b-em for keyboard joystick emulation but it may been on a branch that didn't go anywhere and, I think, since then there has been some revision to the joystick support - Tricky I think that was you?