CPCWiki forum

General Category => CPCWiki Discussion => Topic started by: Devilmarkus on 23:09, 21 July 09

Title: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 23:09, 21 July 09
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
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 10:34, 22 July 09
Here you can see more examples:
http://cpc-live.com/smf/index.php?board=1.0
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: CPCLER on 12:13, 22 July 09
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 (http://cpc-live.com/smf/index.php?board=1.0)
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 13:02, 22 July 09
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.
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Octoate on 14:42, 22 July 09
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.
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Ygdrazil on 14:46, 22 July 09
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.
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 15:35, 22 July 09
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...
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: 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...
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 01:35, 25 July 09
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.
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Gryzor on 09:35, 27 July 09
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...
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Grim on 10:04, 27 July 09
It sounds good to me. As long as my laptop don't crawl when viewing the recent posts (http://cpcwiki.eu/forum/index.php?action=recent) because several applets are loading simultaneously, like it did a few days ago, that's OK =)
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Octoate on 11:33, 27 July 09
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.
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Ygdrazil on 14:13, 27 July 09
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...
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 15:00, 27 July 09
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?
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Gryzor on 18:34, 27 July 09
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...
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Octoate on 20:48, 27 July 09
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>


Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 20:53, 27 July 09
This could work...
Thank you!
I will try this in my forum first.
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Gryzor on 07:22, 28 July 09
Oh wow, really elegant...

Markus, gonna be shopping with the missus this morning, maybe we can work on it afterwards... :D
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 14:44, 28 July 09
got this stuff working!!!!
Try here:
http://cpc-live.com/smf/index.php?topic=9.0 (http://cpc-live.com/smf/index.php?topic=9.0)

BBCode command is not changed! It is the same.
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: 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]
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 19:52, 28 July 09
The question is now:
Should I make the floppy-emulation hearable?
Like in JavaCPC...
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Ygdrazil on 20:12, 28 July 09
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]
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Gryzor on 20:20, 28 July 09
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?
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 00:11, 29 July 09
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
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Gryzor on 00:13, 29 July 09
Yes, but the logo is not clickable.

Lame...
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 00:16, 29 July 09
Quote from: Gryzor on 00:13, 29 July 09
Yes, but the logo is not clickable.

Lame...

I can click it... you not?

(I can click whereever I want *click*)
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Gryzor on 19:25, 29 July 09
Hey! The logo disappeared? Did we not upload the latest version?
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Devilmarkus on 19:55, 29 July 09
Quote from: Gryzor on 19:25, 29 July 09
Hey! The logo disappeared? Did we not upload the latest version?

I still see it... Did you clear your caches?
Title: Re: Planning WebCPC as BBCode applet for CPCWiki forum
Post by: Gryzor on 20:24, 29 July 09
Hm, obviously not well enough... But I see it now :)
Powered by SMFPacks Menu Editor Mod