Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video/Canvas Display Size Issue #13

Open
shaylevary opened this issue Jul 8, 2024 · 5 comments
Open

Video/Canvas Display Size Issue #13

shaylevary opened this issue Jul 8, 2024 · 5 comments

Comments

@shaylevary
Copy link

shaylevary commented Jul 8, 2024

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
Copy link
Owner

nenge123 commented Jul 15, 2024

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants