New emulator: beebjit

discuss bbc micro and electron emulators (including mame) here!
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

what does beebjit need to run?
op my main pc it comes up wit the following:-
F:\BBC\beebjit_win_0.9.0>beebjit.exe
info:tape:rewind

and the window for the emulator pops up very briefly and disappears (falls back to DOS) again but the emulator run fine on my laptop.
Not sure what I am missing on my main computer to be able to run it.
some version of Microsoft Visual C ++ Redistributable or something?
Regards Peter.
User avatar
hoglet
Posts: 12678
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: New emulator: beebjit

Post by hoglet »

If you can update the code to avoid the pext instruction I'd love to try this out.

Dave
User avatar
davidb
Posts: 3398
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: New emulator: beebjit

Post by davidb »

Maybe it says something about me but I very quickly started to wonder if programs running in the emulator might be able to infer things about the host system based on timing information, at least in principle. :twisted:
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

vanekp wrote: Thu Apr 16, 2020 1:12 pm what does beebjit need to run?
op my main pc it comes up wit the following:-
F:\BBC\beebjit_win_0.9.0>beebjit.exe
info:tape:rewind

and the window for the emulator pops up very briefly and disappears (falls back to DOS) again but the emulator run fine on my laptop.
Not sure what I am missing on my main computer to be able to run it.
some version of Microsoft Visual C ++ Redistributable or something?
Can you try the command line option -mode interp to see if it's the JIT issue with older processors?
If not, it's probably something silly I've done in trying to port to Windows, as I'm not a Windows expert at all!


Cheers
Chris
User avatar
Arcadian
Site Admin
Posts: 4223
Joined: Fri Nov 24, 2000 12:16 pm
Contact:

Re: New emulator: beebjit

Post by Arcadian »

I had the same problem as Peter on a Desktop Win 10 PC with a rather old i5-3570K 3.4Ghz CPU (overclocked to 3.8Ghz I think) but using the command line option you specified got it going, so hopefully the same will be true on Peter's machine ...
Please subscribe to the ABug YouTube channel!
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

okay it worked using "-mode interp" mine is also a i5-3570K 3.40GHz Windows 10 PC.
Can anyone recommend a good frontend to use with this emulator?
Thanks all for the advice.
Regards Peter.
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

vanekp wrote: Fri Apr 17, 2020 6:44 am Can anyone recommend a good frontend to use with this emulator?
To reply to my own post I found a FrontEnd that works well with Beebjit called QuickPlay, only small problem was trying to handel disc and tape images, but just created beejit (hfe) and beebjit (uef) as 2 different BBC emulators to use the correct command line to run those images.
Attachments
QuickPlay.png
Regards Peter.
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

scarybeasts wrote: Sun Apr 19, 2020 1:14 am
I can't reproduce any problems with the Boffins. Can you post the images, or provide a link to where you got them from?

Cheers
Chris
Don't think I mentioned it but they are the tape version UEF of Boffin 1&2 as far as I know they came from the STH archive.
Attached are the uncompressed version of them ready to use in beebjit.

only other thing I came across is I could not find the "|" key on the keyboard in beebjit maybe I am missing something.
And is F10 a sort pause key in the emulator (not mentioned in the documentation)? only thing is it causes problems with games/programs that use f0 as it pauses everything every time you press it.
Am really enjoying this emulator its clean fast van very accurate some tape titles that will not load in any of the other emulators work fine in beebjit.
I have moved my reply to here as it has more to do with the emulator than with hfe disc formats.
Attachments
Boffin1&2.rar
(33.08 KiB) Downloaded 88 times
Regards Peter.
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

vanekp wrote: Sun Apr 19, 2020 2:11 pm
scarybeasts wrote: Sun Apr 19, 2020 1:14 am
I can't reproduce any problems with the Boffins. Can you post the images, or provide a link to where you got them from?

Cheers
Chris
Don't think I mentioned it but they are the tape version UEF of Boffin 1&2 as far as I know they came from the STH archive.
Attached are the uncompressed version of them ready to use in beebjit.
Thanks. I did think of the STH tape archive but didn't see any Boffins. Am I missing something??

Anyway, just the one new opcode discovery, $03 == "SLO idx", an 8-cycle monster :D
It's fixed, the next release will have the fix for this and other undocumented opcodes.
only other thing I came across is I could not find the "|" key on the keyboard in beebjit maybe I am missing something.
I don't think you're missing anything. Sorry about that. Good luck finding pound/underscore too! I'll fix this, probably by adjusting to match the jsbeeb keys for consistency unless there are other ideas?
And is F10 a sort pause key in the emulator (not mentioned in the documentation)? only thing is it causes problems with games/programs that use f0 as it pauses everything every time you press it.
The emulator itself doesn't do anything special with F10 / F0. I think this is some Windows special key thing because it's fine on Linux. I'm not a Windows coder but I do seem to be handling the key press but then passing it along for default key press handling. I'll investigate not doing that.
Am really enjoying this emulator its clean fast van very accurate some tape titles that will not load in any of the other emulators work fine in beebjit.
Thanks for the kind words! Could you list some of these tricky tape titles that don't load in all the other emulators? I'm keeping a list of "tricky emulator test cases" as a reference for myself and anyone else interested.


Cheers
Chris
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

The emulator itself doesn't do anything special with F10 / F0. I think this is some Windows special key thing because it's fine on Linux. I'm not a Windows coder but I do seem to be handling the key press but then passing it along for default key press handling. I'll investigate not doing that.
Yes, this seems to be working now. Thanks for reporting it.
Other key mappings now match jsbeeb:
` is BBC @
\ is BBC \
Page Up is BBC underscore / pound

Also matching jsbeeb, "windows keys" is BBC shift lock. It works but windows thinks it owns that key and pops up a start menu :D We can refine this in the future if a good idea presents itself.


Cheers
Chris
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: New emulator: beebjit

Post by lurkio »

Diminished wrote: Tue Apr 14, 2020 2:25 pm
lurkio wrote: Tue Apr 14, 2020 1:15 pm ... because I don't fully understand all the tech involved, it would be great if you could please explain in simple terms what the advantages of beebjit are over BeebEm, to take the obvious example?
Basically it can run BBC Micro software in its native environment (i.e. on a properly emulated BBC system) at 5000 times its native speed (give or take). Largely useless for games, but potentially useful for some other cases. (Although ...
Thanks!
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

scarybeasts wrote: Mon Apr 20, 2020 12:14 am
Thanks for the kind words! Could you list some of these tricky tape titles that don't load in all the other emulators? I'm keeping a list of "tricky emulator test cases" as a reference for myself and anyone else interested.

Cheers
Chris
one program in particular is The Music System by Island Logic till now I have not been able to load it successfully in any other emulator, the closest is jsbeeb but it trips up on the blocks for some reason, and it takes forever to load on there.
and as its the 1st time I have managed to test my uef image I discovered a gap at the end of one of the blocks so it would never load anyway so have redone that image of tape one, I did notice that on the synth program beebjit does mess up the icons but for the rest it works 100%, I have attached a copy of the 1st tape side 1, the original Repton tape is another that does not work on a lot of emulators as it used undocumented op codes to do a timer decode of the loader program
Attachments
TheMusicSystem(IslandLogic)[Tape1Side1].rar
(36.17 KiB) Downloaded 80 times
Regards Peter.
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

scarybeasts wrote: Mon Apr 20, 2020 2:12 am
Yes, this seems to be working now. Thanks for reporting it.
Other key mappings now match jsbeeb:
` is BBC @
\ is BBC \
Page Up is BBC underscore / pound

Also matching jsbeeb, "windows keys" is BBC shift lock. It works but windows thinks it owns that key and pops up a start menu :D We can refine this in the future if a good idea presents itself.

Cheers
Chris
hopefully the []{} keys will also work the same as in jsbeeb the are mapped to the same keys as the character.
ok that's odd about the F10 key pausing the emulator as it only does that in beebjit and none of the other emulators so have no idea where that is coming from.
Regards Peter.
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

vanekp wrote: Mon Apr 20, 2020 10:01 pm one program in particular is The Music System by Island Logic till now I have not been able to load it successfully in any other emulator, the closest is jsbeeb but it trips up on the blocks for some reason, and it takes forever to load on there.
That's interesting! I recently redid the tape <-> serial interactions in jsbeeb. The beebjit code was based on the jsbeeb logic, so it's surprising it works in one but not the other. Anyway, I'm glad it works in beebjit. Not sure I'm going to get time to revisit jsbeeb tape handling any time soon.
and as its the 1st time I have managed to test my uef image I discovered a gap at the end of one of the blocks so it would never load anyway so have redone that image of tape one, I did notice that on the synth program beebjit does mess up the icons
I didn't immediately see that -- are there any particular steps to cause the mess up? I did notice that pressing space bar on the main menu seems to always step forward two options?? The disc version does not do that.

[aside: it's also interesting that @billcarr2005 cited The Music System as an interesting protected disc. Maybe they went to town on tape protection too? For reference, the protected HFE does seem to work in beebjit, there are a few versions here: https://drive.google.com/drive/folders/ ... Prf6jZPWpb]


Cheers
Chris
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

scarybeasts wrote: Tue Apr 21, 2020 9:43 am
That's interesting! I recently redid the tape <-> serial interactions in jsbeeb. The beebjit code was based on the jsbeeb logic, so it's surprising it works in one but not the other. Anyway, I'm glad it works in beebjit. Not sure I'm going to get time to revisit jsbeeb tape handling any time soon.

I didn't immediately see that -- are there any particular steps to cause the mess up? I did notice that pressing space bar on the main menu seems to always step forward two options?? The disc version does not do that.

[aside: it's also interesting that @billcarr2005 cited The Music System as an interesting protected disc. Maybe they went to town on tape protection too? For reference, the protected HFE does seem to work in beebjit, there are a few versions here: https://drive.google.com/drive/folders/ ... Prf6jZPWpb]

Cheers
Chris
on jsbeeb it loads the 1st part (the menu) which has the same protection as the other modules, it gets past the block 03 but seems a bit fussy about reading the specially formatted blocks of the data so not quite sure what goes on there. the stepping forward is because two modules are on tape on and the other 2 modules are on tape 2 and that's how they have split them up. Attached if your interested are both the tapes 1&2 and sides.

Yes it is fairly well protected also on the tape version which is why its one that has caught my eye, and thanks for the disc images of it they are also interesting to look at.
Attachments
TheMusicSystemTape1&2.rar
(84.73 KiB) Downloaded 73 times
Regards Peter.
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

vanekp wrote: Tue Apr 21, 2020 10:35 am Yes it is fairly well protected also on the tape version which is why its one that has caught my eye, and thanks for the disc images of it they are also interesting to look at.
On the topic of beebjit tape loading, I wanted to add notes regarding a couple of other titles you mentioned in another thread:

- Frak. There was an interesting bug here! Now Frak loads so this will be fixed in the next release.
- Match Day. I reproduced the hang at the start of the match, but then I saw b-em behaved the same. So I hammered every key on the keyboard until I noticed that Backspace appeared to cause a kick-off!

I also went back through some jsbeeb bugs I fixed and made a collection of "tough" tapes: https://github.com/scarybeasts/beebjit/ ... test/tapes

These are tapes that are tough on account of custom tape loaders, weird serial ULA / MC6850 corner cases, etc. beebjit now loads them all with the latest code on master.


Cheers
Chris
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

scarybeasts wrote: Wed Apr 22, 2020 9:15 am
On the topic of beebjit tape loading, I wanted to add notes regarding a couple of other titles you mentioned in another thread:

- Frak. There was an interesting bug here! Now Frak loads so this will be fixed in the next release.
- Match Day. I reproduced the hang at the start of the match, but then I saw b-em behaved the same. So I hammered every key on the keyboard until I noticed that Backspace appeared to cause a kick-off!

I also went back through some jsbeeb bugs I fixed and made a collection of "tough" tapes: https://github.com/scarybeasts/beebjit/ ... test/tapes

These are tapes that are tough on account of custom tape loaders, weird serial ULA / MC6850 corner cases, etc. beebjit now loads them all with the latest code on master.


Cheers
Chris
sorry my bad I had forgotten how to play matchday, turns out del is the key to kick off the match, I assumed it had crashed as you man half disappears.

Another you want to add to your list is Joust (added a copy here), it works on beebjit but is well protected and has a very weird loader.
Attachments
Joust(Aardvark).rar
(21.27 KiB) Downloaded 68 times
Regards Peter.
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

vanekp wrote: Wed Apr 22, 2020 6:07 pm sorry my bad I had forgotten how to play matchday, turns out del is the key to kick off the match, I assumed it had crashed as you man half disappears.
That might be addressed by -opt video:render-every-ticks=64
I should probably make that the default for slow / normal mode.
Another you want to add to your list is Joust (added a copy here), it works on beebjit but is well protected and has a very weird loader.
Added. I also checked in a Nightshade UEF since it's such an emulator rite of passage.

I also referenced this great list: http://beebwiki.mdfs.net/List_of_copy_p ... n_cassette


Cheers
Chris
garfield
Posts: 548
Joined: Mon Jan 03, 2005 1:38 am
Contact:

Re: New emulator: beebjit

Post by garfield »

Always good to see a new emulator, especially one that makes strides in certain areas. Competition is healthy. :)

For reference, on another thread, we previously discussed stand-out games (that typically do "interesting" or challenging technical stuff) for the BBC and Master.
Here:
viewtopic.php?f=1&t=8164

( Obviously talking Master and B+ is a step beyond at this point, but probably good to bear these games in mind. )
User avatar
hoglet
Posts: 12678
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: New emulator: beebjit

Post by hoglet »

Chris,
scarybeasts wrote: Tue Apr 14, 2020 6:37 am Yes, "pext" is an exotic instruction that was introduced in Haswell == gen 4?
It's kind of cool actually: https://www.felixcloutier.com/x86/pext

However, I think I may have used the instruction _because it cool_, and not _because it is a good idea_. I don't think it's a good idea because older machines are quite common, and also this instruction is documented as performing terribly on AMD (speaking of emulation, an AMD emulates them instead of having dedicated silicon). (And by terribly we mean: http://i.imgur.com/tQVadpL.png)

If I change beebjit to get rid of them, would you be willing to try again?
Are you still planning to remove pext?

I'm interested in running on a Core2Quad Q9550, which lacks this instruction.

Dave
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

hoglet wrote: Thu Apr 23, 2020 6:36 pm Are you still planning to remove pext?
Yes. It's getting close to the top of the pile.

Removing pext should be easy. Unfortunately there are also some shrx / rorx instructions which need a similarly recent processor. It will take a bit more thinking to replace those.


Cheers
Chris
User avatar
johnnysh
Posts: 55
Joined: Tue Feb 26, 2013 8:15 am
Location: London
Contact:

Re: New emulator: beebjit

Post by johnnysh »

Hi

just wondered if there is a working windows version of your emulator

link is dead?? for windows download ???

thanks
User avatar
vanekp
Posts: 1413
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands
Contact:

Re: New emulator: beebjit

Post by vanekp »

you can dolwnload them on Github Here
Regards Peter.
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

vanekp wrote: Tue Oct 10, 2023 9:51 am you can dolwnload them on Github Here
Thanks for fielding that.
I've got one report that beebjit likes to hang on Windows 11, but didn't hit that myself yet. Any feedback on the Windows build is most welcome.
User avatar
Rich Talbot-Watkins
Posts: 2054
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca
Contact:

Re: New emulator: beebjit

Post by Rich Talbot-Watkins »

Yeah this happens to me, maybe one in ten times... Never got round to debugging it.
SteveF
Posts: 1683
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: New emulator: beebjit

Post by SteveF »

I'm not sure if this is the best place to report this - let me know if I should raise an issue on github.

I've been using beebjit (built from commit 1bed155abdcd8c8fc2f0283019a236e0faaa6f42) to debug my code for BigEd's weekend coding challenge. (And it's amazing - maybe I'm just coding this badly, but finding primes is slow and debugging would be much more painful under a "normal" emulator.) Last night beebjit was mostly working fine, but once in a while I would get the emulator just crashing. If I tried again it worked fine so I just assumed I was doing something wrong and ignored it.

Today it's happening consistently - which isn't to say it won't go away again, of course.

If I launch beebjit with:

Code: Select all

./beebjit -master -fast
and type:

Code: Select all

MODE 0
at the BASIC prompt, the emulator just dies. I've run it under gdb and I get this (boilerplate output has been removed for clarity):

Code: Select all

$ gdb --args ./beebjit -master -fast 
(gdb) run
Starting program: /home/steven/src/beebjit/beebjit -master -fast
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
info:misc:cannot allocate 6502 driver type; falling back to interp
[New Thread 0x7ffff3079640 (LWP 808941)]
info:audio:device: default, rate 48000, buffer 2048, periods 4, period size 512
info:audio:sub-period size 86 time 1791us
[New Thread 0x7ffff2878640 (LWP 808942)]
unimplemented:cmos:WRITE address 0A value 0A
unimplemented:cmos:WRITE address 0A value 0A
unimplemented:cmos:WRITE address 0B value 0B
unimplemented:cmos:WRITE address 0B value 0B
[New Thread 0x7ffff2077640 (LWP 808943)]
unimplemented:misc:write of TUBE region
unimplemented:misc:write of TUBE region
unimplemented:misc:write of TUBE region
unimplemented:misc:write of TUBE region

Thread 1 "beebjit" received signal SIGSEGV, Segmentation fault.
0x0000000000464637 in render_function_2MHz_data_deinterlaced (p_render=0x4ddb70, data=32 ' ', address=10315, ticks=0) at render.c:599
599	    *(struct render_character_2MHz*) p_render_pos = *p_value;
(gdb) bt
#0  0x0000000000464637 in render_function_2MHz_data_deinterlaced (p_render=0x4ddb70, data=32 ' ', address=10315, ticks=0) at render.c:599
#1  0x00000000004654ef in render_render (p_render=0x4ddb70, data=32 ' ', addr=10315, ticks=0) at render.c:1021
#2  0x000000000041d163 in video_render_full_frame (p_video=0x4f5cf0) at video.c:1792
#3  0x00000000004115f2 in beebjit_main () at main.c:736
#4  0x000000000040e3a1 in os_window_main_thread_start (p_beebjit_main=0x40f691 <beebjit_main>) at /home/steven/src/beebjit/os_window_x11.c:114
#5  0x00000000004118b6 in main (argc=3, argv=0x7fffffffdb88) at main.c:813
(gdb) 
I haven't tried to dig into this myself in any detail yet - it's definitely not beyond me, absolutely not, I'm just a bit tied up with Klauber triangles right now. :-)

I'm running Linux Mint 21.2 Victoria on a Ryzen 5700G. I'm happy to provide further details or rebuild correctly or test any fixes, just let me know. (But as I say, while this is currently completely consistent, it's intermittent at some level.)

On a different note: it's always been present, even when beebjit has worked fine, but does the "info:misc:cannot allocate 6502 driver type; falling back to interp" mean I'm not getting all the performance I could be?
User avatar
scarybeasts
Posts: 1052
Joined: Tue Feb 06, 2018 7:44 am
Contact:

Re: New emulator: beebjit

Post by scarybeasts »

SteveF wrote: Sat Oct 21, 2023 3:53 pm I've been using beebjit (built from commit 1bed155abdcd8c8fc2f0283019a236e0faaa6f42) to debug my code for BigEd's weekend coding challenge. (And it's amazing - maybe I'm just coding this badly, but finding primes is slow and debugging would be much more painful under a "normal" emulator.) Last night beebjit was mostly working fine, but once in a while I would get the emulator just crashing. If I tried again it worked fine so I just assumed I was doing something wrong and ignored it.

Today it's happening consistently - which isn't to say it won't go away again, of course.
Thanks for the report. I think I've fixed it in the most recent commit.
It looks like a longstanding (and silly) race condition. I had never encountered it before and it wasn't triggering for me at all when I tried to test it but then the planets aligned?? and it started happening every time. Crazy stuff.
On a different note: it's always been present, even when beebjit has worked fine, but does the "info:misc:cannot allocate 6502 driver type; falling back to interp" mean I'm not getting all the performance I could be?
There's no JIT support for the BBC Master configuration. It should still be pretty quick though because interpreter performance has also been a priority. I suppose I could look at a JIT for the BBC Master one day but it is a headache because of all the BBC Master quirks, such as shadow RAM.


Cheers
Chris
SteveF
Posts: 1683
Joined: Fri Aug 28, 2015 9:34 pm
Contact:

Re: New emulator: beebjit

Post by SteveF »

Thanks Chris! I've just built commit 674dfaa96b048759e65b6b124d83417bcee0d702 and it seems to be working now. It's bizarre how these things can lie dormant and then start acting up.

Thanks for the explanation about no JIT for the Master - it is indeed still amazingly fast, and now I know.
Post Reply

Return to “8-bit acorn emulators”