A New Version Of Beebem!


I played Frak! last night and I was transported straight back to illicit gaming in the computer room at school (25 years ago) when Mr todd wasn't looking - excellent!

I Love the keyboard and mapping features, can I have a play with the keyboard source for use in Vice? I might have another tinker with the key mapping in that.

Thanks for making me load GMenu2x, I had been too lazy to bother before but I love that too.

I just need to try and remember how to make my disk images bootable with shift break as I cannot be bothered to type ch."xxxx"- anyone know how to make a "!boot" file on the beeb?

GREAT WORK GREAT EMULATOR
 
To make the disk bootable

*opt 4,0 : Ignore !BOOT
*opt 4,1 : *LOAD !BOOT
*opt 4,2 : *RUN !BOOT
*opt 4,3 : *EXEC !BOOT

Edit: Read post properly

To make !BOOT script (for use with opt 4 3)

*BUILD !BOOT

Then type

CHAIN"PROGRAM"|M

then press ESC to exit
 
Just a quick post to say thanks to Fru.T Bunn (and rooster) for all their efforts - this looks like a fantastic release, and I'm going to make time to try it out soon :)

Vive le beeb!
 
vic20-ian posted on Feb 26 2007 at 08:54 AM said:
I played Frak! last night and I was transported straight back to illicit gaming in the computer room at school (25 years ago) when Mr todd wasn't looking - excellent!
Ahh, but did you play rude Frak! :lol:

I Love the keyboard and mapping features, can I have a play with the keyboard source for use in Vice? I might have another tinker with the key mapping in that.
Sure, help yourself - consider the following files optionally under either the GNU GPL 2 (or any later version), or the New BSD licence. (But the emulator core remains under the original authors licence).

Files are:

The on-screen virtual keyboard (uses SDL):
virtualkeyboard.cc, virtualkeyboard.h

The keyboard mapper popup keyboard dialog (uses EG):
keyboardmapper.cc, keyboardmapper.h

The keyboard mapping UI page (uses EG):
beebem_pages.cc, beebem_pages.h

Abstraction for GP2x controls (uses SDL):
button.c, button.h

GP2x input (USB keyboard + stick + buttons etc) are controlled by button.c (and button.h). And this code also handles auto repeat.

Basically all it does is except SDL events as input and generate user events which it adds to the SDL event queue as output. So you can write something like this:
Code:
				while ( SDL_PollEvent(&event) ) {
						if (event.type != SDL_USEREVENT) {
								Button_TranslateEvent(&event, mainWin->ScreenIsReversed());
						} else {
								switch ( (intptr_t) event.user.data1) {
								case SDL_USEREVENT_BUTTON_QUIT:
										done = 1;
										break;
								case SDL_USEREVENT_BUTTON_LEFT:
										EG_Window_MoveSmartFocusLeft(dialog_window_p);
										break;

				... etc ...

								case SDL_USEREVENT_BUTTON_CLICK_DOWN:
										EG_Window_Trigger_Select_Down(dialog_window_p);
										break;

								case SDL_USEREVENT_BUTTON_CLICK_UP:
										EG_Window_Trigger_Select_Up(dialog_window_p);
										break;
								}
						}

						/* Send the event to the dialog too:
						 */
						EG_Window_ProcessEvent(dialog_window_p, &event, 0, 0);
				}
As you can see the code simply passes SDL events to button.c and that adds new 'user SDL events' that the rest of the loop then reads in and uses. With this approach any type of smart manipulation of the stick (8 to 4 directions, d-pad conversions, flipped mode etc) can be abstracted away from the code that reads the SDL user events. The EG_ call at the bottom also feeds the raw SDL event to 'EG' too.

Not completely abstracted (as you need to access the SDL user events raw), but can probably be extended.

Mouse support is handled by EG (via the raw SDL events that are passed to EG_Window_ProcessEvent), but this is not yet wired in for BeebEm running on the GP2x - if you compile for a PC then the mouse works fine, but will never work with this damned 'flipped' mode.


EG

EG is 'Economy GUI' and is the GUI API under the pages and widgets in BeebEm (and is housed in the ./gui directory of the source). It's not a fantastic GUI and only supports simple widgets, so no composites etc. Basically you have a window, and that window can have any number of child widgets associated with it. A window manages its child widgets and handles focus control for them (not a fantastic design I'll admit).

Although EG is written in C, the individual widgets are abstracted and interact with their parent window via a consistant callback based interface. For instance, the ToggleButton and RadioButton widgets both depend on the same RadioGroup widget, and EG_Window sees all EG_Widgets as the same thing anyway. There is support for adding new widgets too, and existing ones are easy to mod.

EG was written by me too, and is therefor not limited to the BeebEm license (although it is dual licensed with that). Again consider it GPL2 (or any later version) or New BSD licensed. You'll need it to run the mapper code above, but it's easy to add.

It's not fantasic though, and there are a number of crucial limitations (as you'd imagine for a none OO design), but it's quite convenient to use for popup configuration pages, and compiles to a static library that can easily be linked to - although it can also be included with the source code.

The new file selector I'm working on will become part of EG, also EG supports popup windows style 'message-boxes' (but they do not work on the GP2x yet - will do soon). Also a 'combo-box' widget with associated popup dialog (for the list of options) is in the works to.

EG is however dependent on SDL, but that dependency can probably be faked away etc. Work on EG ended over a year ago now, and I only maintain it for my UNIX BeebEm port (it's used as the other end of an abstraction layer that fakes Window$ MFC calls so the UNIX BeebEm code doesn't need to stray too far away from Windows BeebEm).

EG is sadly really, really crap, if only I was writing it with what I know now...


For all its faults, it is however quite simple to use though. Here is the mandatory "Hello, World!" type example for EG:

Code:
#include <gui/gui.h>
#include <gui/log.h>
#include <SDL.h>
#include <unistd.h>

/* Needed to abstract GP2x buttons to spoon-feed input to EG: */
#include "button.h"

/* Quit callback: */
static void Callback_NotOK(EG_Widget *me_p, void*)
{
		EG_Window_Hide( EG_Widget_GetWindowPtr(me_p) );
}

/* Dialog's event loop (an example of this is in beebem_pages.cc, so you don't
 * normally have to rewrite it): */
static void EventLoop(EG_Window *window_p)
{
		int old_delay;
		SDL_Event event;

		if ( window_p == NULL ) return;
		if ( EG_Window_IsHidden(window_p) ) EG_Window_Show(window_p);

		/* Clear GP2x input state and reset it to 25fps (this is not fantastic,
		 * but...): */
		Button_Reset();
		old_delay = Button_GetAutoRepeatDelay();
		Button_SetAutoRepeatDelay(5);

		/* Event loop, loops until the dialog (window_p) is no longer displayed:
		 */
		do {
				while ( SDL_PollEvent(&event) ) {
						if (event.type != SDL_USEREVENT) {
								Button_TranslateEvent(&event, 0);
						} else {
								/* [TODO] The event payload should be
								 * abstracted via button.c */
								switch ( (intptr_t) event.user.data1) {
								case SDL_USEREVENT_BUTTON_QUIT:
										EG_Window_Hide(window_p);
										break;

							   /* Triggers are EG's way of abstracting input
								 * that isn't managed via the SDL event queue.
								 */

								case SDL_USEREVENT_BUTTON_CLICK_DOWN:
										EG_Window_Trigger_Select_Down(window_p);
										break;
								case SDL_USEREVENT_BUTTON_CLICK_UP:
										EG_Window_Trigger_Select_Up(window_p);
										break;
								}
						}

						/* EG needs these SDL events too (but not really for
						 * the GP2x yet): */
						EG_Window_ProcessEvent(window_p, &event, 0, 0);
				}

				/* Slow things down to 25 fps and handle auto repeats: */
				SDL_Delay(40); Button_RaiseAutoRepeatEvents();

				/* Make sure EG can house keep every once in awhile: */
				EG_Window_ProcessEvent(window_p, NULL, 0, 0);

				/* Fudge for now - bloody 'flipped' mode... */
				SDL_UpdateRect(EG_Window_GetSurface(window_p), 0,0,0,0);

		} while ( ! EG_Window_IsHidden(window_p) );

		/* Be nice and leave button.c as we found it: */
		Button_Reset();
		Button_SetAutoRepeatDelay(old_delay);
}

/* Create the dialog, display it, process events, then free resources. */
void HelloWorld(SDL_Surface *frame_buffer_p)
{
		SDL_Color c = (SDL_Color) {159, 0, 0, 0};
		SDL_Rect r, r2;
		EG_Window *window_p;
		EG_Widget *widget_p;

		if (frame_buffer_p == NULL) return;

		/* Create the dialog: */
		r = (SDL_Rect) { 64, 120-32, 320-128, 64 };
		window_p = EG_Window_Create( "win_grue", frame_buffer_p, c, r);

		/* Add widgets to the dialog (C_1_1 is a macro for easy widget
		 * placement): */
		widget_p = EG_Label_Create( "grue_title", c, EG_LABEL_ALIGN_CENTER
		 , "Warning:", C_1_1(r, 1, 2) );
		(void) EG_Window_AddWidget(window_p, widget_p);

		r2 = C_1_1(r, 3, 6);
		widget_p = EG_Box_Create( "grue_box", EG_BOX_BORDER_SUNK, c, r2 );
		(void) EG_Window_AddWidget(window_p, widget_p);
		r2.x+=4; r2.w-=8;

		widget_p = EG_Label_Create( "grue_body", c, EG_LABEL_ALIGN_CENTER
		 , "V.I.S.T.A. sucks! Bad!", C_1_1(r2, 2, 2) );
		(void) EG_Window_AddWidget(window_p, widget_p);

		widget_p = EG_Button_Create("grue_notok", c, EG_BUTTON_ALIGN_CENTER
		 , "Not OK!", C_1_1(r2, 7, 2) );
		(void) EG_Button_SetMyCallback_OnClick(widget_p, Callback_NotOK, NULL);
		(void) EG_Window_AddWidget(window_p, widget_p);

		/* Show it and wait for user to click button: */
		EventLoop(window_p);

		/* Free resources: */
		EG_Window_DestroyAllChildWidgets(window_p);
		EG_Window_Destroy(window_p);
}

Does this:
vista.png


Well, OK, it's not that short a "Hello, World" example, but I've just typed it in and it worked first time! If you feel that you could live with the above mess, then feel free to use it - I'll package something up etc if you're interested in using it.


Thanks for making me load GMenu2x, I had been too lazy to bother before but I love that too.
Nice isn't it! I especially like the way you get the little loading dialog with the apps icon! Neat!

I'll probably be installing your emulator soon too (even though I don't know the C64 etc), as I've just been reading the history section on Jeff Minter's site (http://www.llamasoft.co.uk/lshistory1.php) and he's published all his old stuff for free download!

The edit = I suck :(
 
Last edited by a moderator:
critical posted on Feb 26 2007 at 09:34 AM said:
Just a quick post to say thanks to Fru.T Bunn (and rooster) for all their efforts - this looks like a fantastic release, and I'm going to make time to try it out soon :)

Vive le beeb!

And a quick note to everyone: My port still contains code from Critical Beeb, so in true FOSS (Free/Open Source Software) fashion Critical has contributed to this joint venture too! :)
 
Last edited by a moderator:
I've been playing a lot of BBC games on this lately and I have to say it's shocking how many start with "would you like instructions? (Y/N)"

There is no throwing you in at the deep end like the vicious arcade machines of the same era...

For there to be such a demand for instructions I can only imagine the conversations going on in the early 80's as enthusiastic families gathered round their new BBC Micros:

So when you say 'computer game' you mean a game on a computer like snakes & ladders? I moved pacman but who's go is it now? It says 'game over' I'm confused. When do I pass go? when do I collect £200?

I'm in a maze and I have to eat the pills and dodge the bad guys.. What? that's nonsense, go back to the bit about the maze and the pills because I'm lost.

Obviously on the BBC Micro if you had a wave of invaders descending down on your rocket base you would be at a complete loss. If only you had some instructions!!

I only remember one person who genuinely needed instructions, my Grandad, who thought he was the gun cross-hair on a flight sim.

While I'm on the subject of classic BBC games, I started one the other day and was greeted by a cheat menu asking me "Would you like a bent game? (Y/N)" They just don't make 'em like that any more.
 
You have the (dis)advantage? of being exposed to video games from an early age. There are so many derivative games that everyone knows what is expected.

When the BBC micro came out there weren't that many video games so people had nothing to compare them with.

I remember someone at school trying to describe pacman to me. I couldn't imagine it, it was a totally new game unlike any that had been before.
 
For 'instructions', you should maybe read 'list of controls'. All the programmers tended used different sets of keys for each game. Joysticks were much less supported then.

The best guess was usually ZX:/ (left/right/up/down) though...

Have you managed to configure Revs so you can steer yet?

Also, there seems to be some sort of funny when you hold down several keys. For example, in Thrust, if you start thrusting, then rotate and fire, sometimes you lose the fact that the thrust key is being held. On the BBC I seem to remember there was a limit of three keys being held down at one time (when using INKEY -values) but Thrust was definitely more playable than it is at the moment...
 
Parkydr posted on Mar 1 2007 at 04:02 PM said:
You have the (dis)advantage? of being exposed to video games from an early age.
Not really, my earliest game playing memory is playing Atari's Asteroids (rel. 1979) in 1980. So the industry was still very much in it's infancy in my childhood. It's not like I was born during the release of Sonic The Hedgehog.

Parkydr posted on Mar 1 2007 at 04:02 PM said:
When the BBC micro came out there weren't that many video games so people had nothing to compare them with.

I remember someone at school trying to describe pacman to me. I couldn't imagine it, it was a totally new game unlike any that had been before.
Sounds like quite a dizzying experience you had there.
I managed just fine with my BBC Model B without needing too much instructional advice.
Or to be precise - offered instructions on every single game every time I play, even though I'm loading them up for the 1000th time. What were they thinking? Did they do that on the Commodore 64 or Speccy? I don't remember so many instructions over there..

Gruntfuggly posted on Mar 1 2007 at 04:10 PM said:
Have you managed to configure Revs so you can steer yet?
No and I couldn't figure out the keys on my real BBC either back in the day.
Shame cos it was supposed to be the best ever racer on the beeb.
 
Last edited by a moderator:
rooster posted on Mar 1 2007 at 05:13 PM said:
Gruntfuggly posted on Mar 1 2007 at 04:10 PM said:
Have you managed to configure Revs so you can steer yet?
No and I couldn't figure out the keys on my real BBC either back in the day.
Shame cos it was supposed to be the best ever racer on the beeb.
It was an absolute bastard to control.

The Micro User Guide to controlling Revs by keyboard is actually here:

http://www.stairwaytohell.com/gamehelp/GUIDE-Revs-MU.html

Don't leave home without it.
 
Last edited by a moderator:
critical posted on Mar 1 2007 at 05:32 PM said:
The Micro User Guide to controlling Revs by keyboard is actually here:

http://www.stairwaytohell.com/gamehelp/GUIDE-Revs-MU.html

Don't leave home without it.
I never leave home without at least one copy of Micro User, primarily because I never know when I might get the urge to spend 3 days typing in one of their fine BASIC listings ;)

EDIT: I just thought... there's only one thing more fun than typing in a Micro User program listing - typing a Micro User program listing in on the virtual keyboard with your joystick. Beat that for pure pleasure.
 
Last edited by a moderator:
rooster posted on Mar 1 2007 at 06:00 PM said:
EDIT: I just thought... there's only one thing more fun than typing in a Micro User program listing - typing a Micro User program listing in on the virtual keyboard with your joystick. Beat that for pure pleasure.
My girlfriend doesn't believe that when I was a kid I used to index all the articles and put them in ring binders, with an index on the front of each. Hehehe... wait 'til I visit my parents next and get them from the attic. On second thoughts, that might scare her a bit too much ;)
 
Last edited by a moderator:
critical posted on Mar 1 2007 at 06:10 PM said:
My girlfriend doesn't believe that when I was a kid I used to index all the articles and put them in ring binders, with an index on the front of each. Hehehe... wait 'til I visit my parents next and get them from the attic. On second thoughts, that might scare her a bit too much ;)
She'll probably be delighted to read some of the back issues you've got tucked away there.
Starting with classic articles like Successful Text Adventuring For Young Adults or How To Beat The Rubik's Cube Harnessing The Explosive Power Of 6502 and then moving on to Germs: Why your hands can never be 100% clean (a BBC BASIC germ simulation).
Don't believe the ludicrous myths that ladies are charmed by flowers and chocolates, most would rather trawl through back issues of Micro User in a dusty attic. Fact. It's also a great place to propose too if you're thinking along those lines gents. Although I'd save the big question until you've spent 2 hours talking them through a heavy machine code subroutine by which point they'll be so impressed a "no" will be simply out of the question :)
 
Last edited by a moderator:
rooster posted on Mar 1 2007 at 06:00 PM said:
I never leave home without at least one copy of Micro User, primarily because I never know when I might get the urge to spend 3 days typing in one of their fine BASIC listings ;)

I'll never forget typing in the game from the third or fourth Micro User which was a shootemup with 3 phases. I thought I had it pretty well debugged and it was quite playable, but when I finally got a copy off the tape it was virtually a different game!

Those were the days... :rolleyes:

Thanks for the Revs link Critical - I'll get Revs working once I've sobered up... (why is it there always ends up something important to do once you've had a few beers!)
 
Last edited by a moderator:
Gruntfuggly posted on Mar 1 2007 at 04:10 PM said:
but Thrust was definitely more playable than it is at the moment...

I may be executing a few too many 6502 instructions before synchronising SDL input with the Beeb's VIAs. Plus there are some updates I need to apply to fix timing issues etc. So much work to do before it's finished.. :(

Gruntfuggly posted on Mar 1 2007 at 11:30 PM said:
(why is it there always ends up something important to do once you've had a few beers!)

Sods law! :lol:
 
Last edited by a moderator:
Fru.T Bunn posted on Mar 1 2007 at 11:33 PM said:
I may be executing a few too many 6502 instructions before synchronising SDL input with the Beeb's VIAs. Plus there are some updates I need to apply to fix timing issues etc. So much work to do before it's finished.. :(
i just looked on stairwaytohell and you've got dudes buying (or at least considering) a GP2X on the strength of this port. damn right! that's progress :)

where's the paypal donate button!?
 
Last edited by a moderator:
rooster posted on Mar 2 2007 at 08:13 AM said:
i just looked on stairwaytohell and you've got dudes buying (or at least considering) a GP2X on the strength of this port. damn right! that's progress :)
Yeah, they are a canny bunch on STH. :)

where's the paypal donate button!?
I'm going to set something up soon.
 
Last edited by a moderator:
Can I just say a massive "thank you" to all involved in this brilliant emulator. I was always a little frustrated with the speed of the previous releases, but this is truly playable and I haven't been able to put it down since the release.

It's probably because I spent so much of my childhood playing Electron/ Beeb games that these are the ones I want to play now, but some of the games are still truly fantastic and massively addictive. Exactly what you need for a hand-held console. At the moment I can't get enough of Starship command, Thrust and this time around I'm looking forward to actually finishing Exile. What an awesome game!

OK, that's enough gushing.

I can't wait for the next release. I'm looking forward to the addition of "save states" so that I can keep scoreboards.
Also, why not make use of the pretty virtual keyboard for the key mapping option? - I'm sure you will have already thought of these things, but hey :)

Keep up the good work and let us know how to donate when you get chance.
 
EDIT: I just thought... there's only one thing more fun than typing in a Micro User program listing - typing a Micro User program listing in on the virtual keyboard with your joystick. Beat that for pure pleasure.

Howabout, typing in an Acorn User machine-code listing??
 
ste_167 posted on Mar 6 2007 at 10:28 AM said:
Howabout, typing in an Acorn User machine-code listing??
Didn't they use assembly normally, though? I think the magic went out of typing listings in for me when they started doing that checksumming stuff. Where's the fun in that?
 
Last edited by a moderator:
Back
Top