nenge123 / emulatorjs

https://emulatorjs.com/
15 stars 12 forks source link

Video/Canvas Display Size Issue #13

Open shaylevary opened 4 months ago

shaylevary commented 4 months ago

Hi,

First of all, I would like to say thank you again for this amazing project, I've been looking for a long time for a decoded dversion of emulatorjs.com.

I would appreciate some help regarding 2 issues i've encountered when running the script:

  1. When I run the script without iframe, the window does not open in full size. Is there anyway i can add some html/css code so the script will open the window at full size? (The emulator script window gap appears in red background)

  2. When running the Amiga emulator, the video resolution is not displayed on the entire screen (there is a black part below and on the sides). In the latest core version of emulatorjs, there is an option to select ZOOM VIDEO, which allows the video to open on the entire screen. Is it possible to change the code of the emulator.js in order to support the display of the video window on full screen?

amiga_emu

Thank you.

nenge123 commented 4 months ago

the core object "Moudule"

Moudule.setCanvans(width,height)

You must understand the aspect ratio of the game.

//you can see in log

gba is 240x160

Moudule.setCanvans(240,160) if you want to HD then Moudule.setCanvans(240 * 5,160 * 5);

how to full ? set css code canvan{ width:100vw;height:100vh;}

keep aspect;

canvan{ width:calc(100vh * 240 / 160 );height:100vh;} Moudule.setCanvans(screen.width,screen.height)

shaylevary commented 4 months ago

The amiga core resolution appear in the log as: [INFO] [Video]: Video @ 360x288

But the content appears in resolution of: 640x400

I guess i need to edit the amiga core: retroarch.js in order to change the canvas resolution. Can you please tell me how do i update the resolution, because i've tried to add to emulatorjs.css the css code you've suggested, but it didn't change anything: canvas{ width:calc(100vh * 240 / 160 );height:100vh;}

(you wrote canvan, but i guess it was misspelling issue).

Thank you.

nenge123 commented 4 months ago

mobile write have so err

you search code "callMain"

under line add Module.setCanvans(360,288);

or search Module =

in func print

print(log) get video size if /[INFO]\s[Video]: /.test(log)

Module.setCanvans(360,288);

at last delete other "Module.setCanvans"

nenge123 commented 4 months ago

emulatorjs default set 640 480,

so you cant wait few time use setCanvans()

setCanvans is set Actual pixels output

css is set Display size

nenge123 commented 4 months ago

If the black edge is not displayed, the output pixels must conform to the aspect ratio of the game.

If you want to fill the screen, force it to stretch through css.