News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Devilmarkus

Planning WebCPC as BBCode applet for CPCWiki forum

Started by Devilmarkus, 23:09, 21 July 09

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Devilmarkus

Hi together,
as I talked today with Gryzor, we are planning to create 2 new BBCode commands to embed WebCPC in postings!

I already coded this feature on a test forum.
So we can include this new BBCode commands soon.

The syntax is quite simple!

[cpc=http://yourdomain.com/mydisk.dsk,disc.bas]CPC6128[/cpc]

This is all you need to setup a running CPC in your thread, with a dsk in the drive and an autorun command.
The CPC6128 between [cpc.....] and [/cpc.] sets the wanted model.

Further informations will follow.

Here is a preview:
http://cpc-live.com/smf/index.php?topic=2.msg6#msg6
This forum will be erased soon, when CPCWiki forum is ready.

(Feel free to register, and try around)

Cheers,
Markus
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

CPCLER

This awesome news .. Most cool feature forever!

What is miss though is a propper tutorial on how to embed the WebCPC in the CPCWIKI pages.

Playing around with the examples yesterday on the CPCWIKI.. I had some trouble making it work..

Also an in depth explanation on what the parameters do (their initial value etc..) How to autoboot a sna file, setting the dsk file etc. etc. And how to avoid weird rendering of the emulator in the webpage.. (What sizes are allowed).

I think embedding an emulator direct to webpages are breathtaking news! Keep up the most impressive work!

/CPCLER



Quote from: CPC-Live on 10:34, 22 July 09
Here you can see more examples:
http://cpc-live.com/smf/index.php?board=1.0

Devilmarkus

Quote from: CPCLER on 12:13, 22 July 09
Playing around with the examples yesterday on the CPCWIKI.. I had some trouble making it work..

This is not yet implemented on CPCWiki!
But feel free to register on my test-forum and play around.
Syntax:

[cpc=http://yourdomain.com/yourdsk.dsk,bootme.bas,CRTC(0/1)]CPCTYPE[/cpc]


To explain:
first parameter (URL with dsk) can contain:
.dsk
.sna
.cdt
.zip (zipped dsk, sna or cdt)
second parameter (bootme.bas):
The program to launch or "tape" when CDT (without "")
third parameter: CRTC type (if not set, 0 is default)
between the [cpc...][/cpc.] is CPCTYPE
this can be:
CPC464
CPC464T (without amsdos)
CPC664
CPC6128
PARADOS (cpc 6128 with parados rom)

If you load a SNA or don't want to boot a dsk/tape, use "none" as boot parameter (without "").
Should be easy, I think.
Here's an example of loading a snapshot without boot but with CRTC set:
[cpc=http://cpc-live.com/webcpc/system/cpc/file/hitechpreview.zip,none,0]CPC6128[/cpc]

EDIT:
You can also setup a half-sized CPC:

[cpcsmall=http://yourdomain.com/yourdsk.dsk,bootme.bas,CRTC(0/1)]CPCTYPE[/cpcsmall]


Same syntax than [cpc...]

But please regard:
Only use 1 applet per thread / threads page!!!
More than 1 applet may cause problems.
Your posting must also contain some text!
If you only enter the [cpc...] command, you will get an error message.
Simply enter a description, too, like I did in my test postings.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Octoate

Quote from: CPC-Live on 13:02, 22 July 09
But please regard:
Only use 1 applet per thread / threads page!!!
More than 1 applet may cause problems.
TBH, I don't like applets in webpages, especially if I don't expect them. I fear to see an applet in every new thread here in the board or in articles of the CPC Wiki which would make the pages really annoying. If you implement this, then please think about a "Preview in WebCPC" button, which e.g. opens a new window with the emulator or includes a layered frame with the emulator, but don't load it directly when the page is loaded.

Ygdrazil

I was thinking exactly the same... A view in WebCPC button!

Otherwise great job!

/Ygdrazil

Quote from: Octoate on 14:42, 22 July 09
TBH, I don't like applets in webpages, especially if I don't expect them. I fear to see an applet in every new thread here in the board or in articles of the CPC Wiki which would make the pages really annoying. If you implement this, then please think about a "Preview in WebCPC" button, which e.g. opens a new window with the emulator or includes a layered frame with the emulator, but don't load it directly when the page is loaded.

Devilmarkus

Quote from: Octoate on 14:42, 22 July 09
TBH, I don't like applets in webpages, especially if I don't expect them. I fear to see an applet in every new thread here in the board or in articles of the CPC Wiki which would make the pages really annoying. If you implement this, then please think about a "Preview in WebCPC" button, which e.g. opens a new window with the emulator or includes a layered frame with the emulator, but don't load it directly when the page is loaded.

What about a special category for WebCPC?
A new category where all users can post with WebCPC in  ;D
So the User can choose if he opens the thread or not...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Valid points. At the moment we're trying to create a function where the applet will be hidden until a [spoiler ]-like tag is pressed and then the applet will load. I think this would be the best solution, but we haven't managed to do it just yet...

Devilmarkus

I updated WebCPC to version 1.1.

- It has some integrated features for future plans of BBCode.
- It needs to be activated first now (click into the applet to run it)
- It uses JavaCPC's FDC emulation, which allows more DSK formats and also dual-sided DSKs.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Can I ask those who disliked (and rightly so) the idea of the applet going off in pages without warning -- does this solution look good to you? I mean, having to press Play before it begins playing?

If yest, then we could start posting games in every thread...

Grim

It sounds good to me. As long as my laptop don't crawl when viewing the recent posts because several applets are loading simultaneously, like it did a few days ago, that's OK =)

Octoate

At least that wasn't what I meant. It isn't the loading time nor the runtime of the WebCPC that I don't like (but it's a great idea to start emulator only when you click the emulator), but it is the Java Runtime which needs to be loaded when I visit a thread with an emulator.
To solve that, you can, for example, insert a div-tag into the HTML code, which only shows an emulator image and insert a ECMA script method in the onclick attribute. When you call the ECMA script (click on the div-tag) the method is called and inserts the necessary applet-code into the div-tag. With this method, the Java Runtime would only be loaded if you click and therefore start the emulator.

Ygdrazil

Hi Gryzor

This is the solution I think we are looking for.. (If you mean a small HTML rendered button that when  pressed will expand a field that activates code for loading the applet - Sounds like a JScript task to me!)

A shame this solution doesn't seem to work, after all the hassle you guys have had integrating WebCPC, which is a really cool and almost a revolutionary idea! - When doing a site about a retro platform, why not have a on-line emulator!!!! Seems so obvious now that it can amaze why someone here didn't think doing this before.

But generally loading heavy applets by default is a bad idea especially from a usability point of view. People simply expect pages to load without technical difficulties(and right so) - to read a simple forum entry they don't expect to run a applet that may cause the browser to refuse loading the page or even worse make the browser crash (like it does on my smartphone  :P ) Second with the increase in different platforms (smartphones, netbooks etc.) users tend to access the internet from not only their desktop workhorses (with the power and all the up to date and correct versions of plugins etc. installed) but more limited platforms. It would be a shame if the CPCWIKI would exclude such a use, by displaying content that will result in errors.

I think that users should be given options to expand the contents of postings / articles to a degree of their own liking and technical abilities. This would not be the case if Applets make the postings unreadable.

Even though i think WebCPC is near genius, I think we should wait enabling applets - until a AJAX/JScript solution has been found.

/Ygdrazil


Quote from: Gryzor on 10:15, 23 July 09
Valid points. At the moment we're trying to create a function where the applet will be hidden until a [spoiler ]-like tag is pressed and then the applet will load. I think this would be the best solution, but we haven't managed to do it just yet...

Devilmarkus

#13
A solution could be simple:

I could code a small php page, which catches the commands from BBCode command, so a link will appear in the thread.
When you click on it, WebCPC would start in a seperate window using parameters from BBCode command...

But I prefer the "applet in thread" way... Maybe we could get the "spoiler" thing working?
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Hello guys,

reading you loud and clear... I see your point, and I thought of it myself - that's why I asked. Although mobile viewers are a teeny-tiny percentage here, indeed having a problem-free web-page to load is of essence.

What we're trying to look into, with Markus, is a a spolier-tag-like solution that would load the script after being clicked on.

I think loading it in a new page kind of defeats the purpose...

Octoate

I just had some minutes to code what I meant. Here is the result. At the loading time, the image 'emupreview.jpg' is shown. After you click the image, the applet html code will be inserted and the emulator starts. Really simple. I attached the complete code (with emulator, image, dsk) to this posting.

<html>
<head>
<script type='text/javascript'>
 baseDirectory = './';
 
 function generateAppletCode(urlToGame, boot)
 {
    appletCode = '<' + 'applet archive="WebCPC.jar" name="WebCPC$5" code="jemu.ui.JEMU.class" ' +
             //'codebase="http://cpcwiki.eu/webcpc/"' +
             ' width="768" height="544"' + '><' + 'param name="URL"' +
             'value="true"' + '><' + 'param name="FILE" value="' + urlToGame + '" /><param name="BOOT" value="' + boot + '" />' +
             '<param name="CRTC" value="1" /' + '><' + 'param name="CPC" value="CPC6128" /' + '><' + '/applet' + '>';
    return appletCode;
 }

 function loadEmulator(divId, game, boot)
 {
    divElement = document.getElementById(divId);
    if (divElement)
    {

       divElement.innerHTML = generateAppletCode(baseDirectory + game, boot);
    }
    else
    {
       alert("Couldn't find div element '" + divId + "'!");
    }
 }
</script>
</head>
<body>
 <div id='emulator'><img src='./emupreview.png' onClick='loadEmulator("emulator", "pheelone.dsk", "pheelone");'/></div>
</body>
</html>



Devilmarkus

#16
This could work...
Thank you!
I will try this in my forum first.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Oh wow, really elegant...

Markus, gonna be shopping with the missus this morning, maybe we can work on it afterwards... :D

Devilmarkus

#18
got this stuff working!!!!
Try here:
http://cpc-live.com/smf/index.php?topic=9.0

BBCode command is not changed! It is the same.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

We implemented this javascript now into this forum, too.
You can post WebCPC now everywhere you want.
A small image will appear, and when you click it, your applet will open.

Check it here:
[cpc=http://cpcwiki.eu/useruploads/content/Not_Dead_Arkos.dsk,-notdead,0]CPC6128[/cpc]
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

The question is now:
Should I make the floppy-emulation hearable?
Like in JavaCPC...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Ygdrazil

Great Scot! This is brilliant!  ;D Even more fast and elegant than I expected!

Great work

/Ygdrazil

PS. Will this also work in the CPCWIKI?

Quote from: Devilmarkus on 17:07, 28 July 09

We implemented this javascript now into this forum, too.
You can post WebCPC now everywhere you want.
A small image will appear, and when you click it, your applet will open.

Check it here:
[cpc=http://cpcwiki.eu/useruploads/content/Not_Dead_Arkos.dsk,-notdead,0]CPC6128[/cpc]

Gryzor

Floppy sound is nice indeed, unless you switch to full speed and bypass all the loading...

As for the wiki, hmmmmm haven't really thought about it yet... would it really be so important?

Devilmarkus

Emulator updated!
It has a nice interface now and ...... a CPCWiki logo inside  ;D ;D ;D

For the CRTC-Button:
- if it's white = CRTC 0
- if it's light-gray = CRTC 1
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Yes, but the logo is not clickable.

Lame...

Powered by SMFPacks Menu Editor Mod