Author Topic: .  (Read 143209 times)

0 Members and 1 Guest are viewing this topic.

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #50 on: 12:27, 07 October 10 »
.
« Last Edit: 16:59, 30 June 21 by PhilZeVibe »

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #51 on: 13:58, 07 October 10 »
.
« Last Edit: 16:59, 30 June 21 by PhilZeVibe »

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #52 on: 15:54, 07 October 10 »
.
« Last Edit: 16:59, 30 June 21 by PhilZeVibe »

Offline Grim

  • CPC6128
  • ****
  • Posts: 202
  • Country: gp
  • La pak ba, bèf ka pasé
    • THERE IS NO GAME
  • Liked: 134
  • Likes Given: 67
Re: CPCBox, your CPC emulator in Javascript
« Reply #53 on: 15:57, 07 October 10 »
I'm using Opera on a 6yo laptop here, and it works quite nicely for what it is (~17fps).

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: CPCBox, your CPC emulator in Javascript
« Reply #54 on: 18:31, 07 October 10 »
All I do is pushing the canvas every time I finished rendering a frame and the rest is automagically taken care of by the browser.

So simple:
Add code, which prevents a "update image" until previous image has not been painted.
(I mean: Also don't do a internal vsync/gatearray render update until last paint hasn't finished yet)
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

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #55 on: 19:03, 07 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.998
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4083
  • Likes Given: 7368
Re: CPCBox, your CPC emulator in Javascript
« Reply #56 on: 09:33, 17 October 10 »
Finally got to try  the last version.

Athlon II 635 @2.9GHz,
Windows 7 Ultimate 64x,
Opera 10.70.34.77

Seems to be working with no issues at 40fps with tons of other windows open. Now waiting for sound implementation... ;)

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #57 on: 21:32, 17 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.998
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4083
  • Likes Given: 7368
Re: CPCBox, your CPC emulator in Javascript
« Reply #58 on: 10:42, 18 October 10 »
But, wait, I thought that there are HTML-based video players that also play audio?

Otherwise, I find it strange that they'd design something as powerful as this without any sound support...?

Online andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.003
  • Liked: 487
  • Likes Given: 82
Re: CPCBox, your CPC emulator in Javascript
« Reply #59 on: 15:27, 18 October 10 »
But, wait, I thought that there are HTML-based video players that also play audio?
The HTML5 video tag will let you play back videos with audio, but it's a whole different kettle of fish if you want to generate audio programmatically

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.423
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1100
  • Likes Given: 2683
Re: CPCBox, your CPC emulator in Javascript
« Reply #60 on: 17:10, 18 October 10 »
It shouldn't be that different.


You have to decode the audio stream of the video file somewhere. And that place is the same where you should have to put your programatically created audio data.


Edit: The "Media" interface from which the "Audio" object inherits seems to have a nice set of functions for controlling the media and its rendering. I don't now if it's a must to write a codec for the media type or you can do it on the fly.
« Last Edit: 17:59, 18 October 10 by robcfg »

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #61 on: 18:59, 18 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.423
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1100
  • Likes Given: 2683
Re: CPCBox, your CPC emulator in Javascript
« Reply #62 on: 19:24, 18 October 10 »
Do you know if there is some kind of communication between the codec and the HTML5 code running?


If some info could be sent to the codec, it would appear to the browser like a streamed file but under control of the code.


Of course it's only a crazy idea, but It seems too odd for me that you can make palette rotation in an image canvas and not something similar for audio...

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #63 on: 19:42, 18 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: CPCBox, your CPC emulator in Javascript
« Reply #64 on: 20:11, 18 October 10 »
Another problem I see here is:
The emulator does not run with 100% speed!
So a probably emulated sound would make a crap output.
Sad, the timing does not depend much on painting the image, because if not, phi2x could simply skip 3 frames and have less fps but faster emulation.
(Add manual frameskip could be a solution with radiocheckboxes to choose how many frames should be skipped)

But until the emu does not reach 100% speed it also makes not much sense to emulate sound.
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

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #65 on: 20:21, 18 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: CPCBox, your CPC emulator in Javascript
« Reply #66 on: 20:34, 18 October 10 »
And that's not even mentioning the fact that, due to the added computations, AY sound emulation would slowdown CPCBox even more  :(

Well, only a 1mhz device more to emulate  :P
(But I think you already emulate it partially to enable keyboard input)
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

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.423
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1100
  • Likes Given: 2683
Re: CPCBox, your CPC emulator in Javascript
« Reply #67 on: 21:42, 18 October 10 »
I think you can play an audio file within the audio tag with a different speed, that would made it work like a tracker (in  some way).


Could it be possible to use a sample of a square wave and play it looped altering the volume and pitch to match the desired sound?

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #68 on: 22:13, 18 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.423
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1100
  • Likes Given: 2683
Re: CPCBox, your CPC emulator in Javascript
« Reply #69 on: 23:17, 18 October 10 »
Ok, it's a bit of a  longshot but the theory is sound, hehehe  :P


Maybe I'll be trying it just for curiosity... maybe...

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1018
  • Likes Given: 926
Re: CPCBox, your CPC emulator in Javascript
« Reply #70 on: 23:27, 18 October 10 »
A YM player is simple to code  8)
It only took me 1-2 hours to get some sound of the AY-emulation from JavaCPC (JEMU).
Then another 1-2 days to build the GUI and improve some things...
You only need is:
- AY emulation
- Timers
- PPI emulation + IO
- some crap
- and a few cans of coffee
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

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #71 on: 01:34, 22 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #72 on: 19:27, 30 October 10 »
.
« Last Edit: 17:00, 30 June 21 by PhilZeVibe »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.998
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4083
  • Likes Given: 7368
Re: CPCBox, your CPC emulator in Javascript
« Reply #73 on: 19:32, 30 October 10 »
So I can now play at full speed on my netbook?? ;)

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
  • Liked: 165
  • Likes Given: 187
Re: CPCBox, your CPC emulator in Javascript
« Reply #74 on: 19:41, 30 October 10 »
.
« Last Edit: 17:01, 30 June 21 by PhilZeVibe »