Giter Site home page Giter Site logo

vc64web / virtualc64web Goto Github PK

View Code? Open in Web Editor NEW
40.0 4.0 4.0 5.61 MB

vc64web - Commodore C64 Emulator for iPad iPhone Android and the Web with CSDb access for thousands of demos at your fingertip.

Home Page: https://vc64web.github.io/doc/about.html

License: GNU General Public License v3.0

C++ 47.13% C 15.50% Makefile 0.29% Shell 0.01% HTML 2.42% JavaScript 33.24% CSS 1.42%
commodore-64 commodore64 html5 pwa ios virtualc64 emulation c64 csdb demoscene

virtualc64web's Introduction

virtualc64web's People

Contributors

dirkwhoffmann avatar mithrendal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

virtualc64web's Issues

detecting producer of rom type

to be able to display the logos "MOS" or "MEGA-ROMS" at the romdialog vc64web implements a detection which is implemented in javascript and which more or less mirrors the detection in the CPP code. No good, no?

Idea: we kick the duplicated code ... by moveing it into the v4 cpp core ...

dirk any thoughts ?

Suggestion: Implement automatic Warp Mode just as the native VirtualC64

My favorite C64 game has 148 blocks. Loading it in virtualc64web takes ages. Maybe time did mollycoddle me, but in the year 2020 I am just not used to waiting that long any more :-)

The native VirtualC64 has a nice feature that turbo boosts the whole C64 while disk accesses are happening. Pretty neat.

SID underflow / overflows

to check the last consumerπŸ€— of mach_absolute_time I enabled
c64->sid.setDebugLevel(2);

when running vc64web ... this interestingly logs overflows in the sid every second or so 😳

SIDBridge: SID RINGBUFFER OVERFLOW (r: 10240 w: 9545) vC64.html:1:528
stdlib_now: 1587285309152000000, emsdk_now: 37160, fake_now: 36 vC64.html:1:368
SIDBridge: SID RINGBUFFER OVERFLOW (r: 8192 w: 7498) vC64.html:1:528
stdlib_now: 1587285310500000000, emsdk_now: 38508, fake_now: 37 vC64.html:1:368
SIDBridge: Changing sample rate from 44100 to 44100 vC64.html:1:528
ReSID: Setting sample rate to 44100 samples per second. vC64.html:1:528
FastSID: Setting sample rate to 44100 vC64.html:1:528
SIDBridge: SID RINGBUFFER OVERFLOW (r: 0 w: 11637) vC64.html:1:528
stdlib_now: 1587285312270000000, emsdk_now: 40277, fake_now: 38 vC64.html:1:368
SIDBridge: SID RINGBUFFER OVERFLOW (r: 2048 w: 1657) vC64.html:1:528
stdlib_now: 1587285313706000000, emsdk_now: 41714, fake_now: 39 vC64.html:1:368
SIDBridge: SID RINGBUFFER OVERFLOW (r: 6144 w: 5435) vC64.html:1:528

when vc64web is halted it logs many many underruns per second ... watch out for MSG_HALT where the underruns wave begins

SIDBridge: SID RINGBUFFER OVERFLOW (r: 6144 w: 5508) vC64.html:1:528
stdlib_now: 1587285373442000000, emsdk_now: 101449, fake_now: 85 vC64.html:1:368
SIDBridge: SID RINGBUFFER OVERFLOW (r: 2048 w: 1671) vC64.html:1:528
stdlib_now: 1587285375024000000, emsdk_now: 103030, fake_now: 86 vC64.html:1:368
SIDBridge: Changing sample rate from 44100 to 44100 vC64.html:1:528
ReSID: Setting sample rate to 44100 samples per second. vC64.html:1:528
FastSID: Setting sample rate to 44100 vC64.html:1:528
SIDBridge: SID RINGBUFFER OVERFLOW (r: 8192 w: 7370) vC64.html:1:528
stdlib_now: 1587285377947000000, emsdk_now: 105953, fake_now: 87 vC64.html:1:368
wasm_halt vC64.html:1:368
Calling emscripten_pause_main_loop vC64.html:1:368
Called emscripten_pause_main_loop vC64.html:1:368
vC64 message=MSG_HALT, data=0 vC64.html:1:368
SIDBridge: SID RINGBUFFER UNDERFLOW (r: 0 w: 1784) vC64.html:1:528
stdlib_now: 1587285378321000000, emsdk_now: 106327, fake_now: 88 vC64.html:1:368
SIDBridge: SID RINGBUFFER UNDERFLOW (r: 4096 w: 5880) vC64.html:1:528
stdlib_now: 1587285378414000000, emsdk_now: 106419, fake_now: 89 vC64.html:1:368
SIDBridge: SID RINGBUFFER UNDERFLOW (r: 8192 w: 9976) vC64.html:1:528
stdlib_now: 1587285378507000000, emsdk_now: 106513, fake_now: 90 vC64.html:1:368
SIDBridge: SID RINGBUFFER UNDERFLOW (r: 0 w: 1784) vC64.html:1:528
stdlib_now: 1587285378599000000, emsdk_now: 106606, fake_now: 91 vC64.html:1:368
SIDBridge: SID RINGBUFFER UNDERFLOW (r: 4096 w: 5880) vC64.html:1:528
stdlib_now: 1587285378692000000, emsdk_now: 106698, fake_now: 92 vC64.html:1:368
SIDBridge: SID RINGBUFFER UNDERFLOW (r: 8192 w: 9976) vC64.html:1:528
stdlib_now: 1587285378785000000, emsdk_now: 106791, fake_now: 93 vC64.html:1:368
SIDBridge: SID RINGBUFFER UNDERFLOW (r: 0 w: 1784) vC64.html:1:528

Question for the underruns...
does that mean that when I put the c64web to halt, that I have to stop reading samples from the SID in my web audio stream ?

Question for the overruns ...
does the web Audio has to read more often or a larger amount to prevent these ?

is it ok when I only read mono samples like in the current implementation?

void MyAudioCallback(void*  thisC64,
                       Uint8* stream,
                       int    len)
{
    C64 *c64 = (C64 *)thisC64;
    c64->sid.readMonoSamples((float *)stream,len /  sizeof(float) );
}


Is the the over and underruns a bad thing that has to be corrected or should I just don't care about it ? Sound for my ears is fine anyway...

What is strange though is that the core periodcally likes to change sample rate from ... well ... 44100 to 44100 πŸ™„... why did it want to do that ?πŸ€”

SIDBridge: Changing sample rate from 44100 to 44100 vC64.html:1:528
ReSID: Setting sample rate to 44100 samples per second. vC64.html:1:528
FastSID: Setting sample rate to 44100 vC64.html:1:528

building a local stored persistent snapshot library

we have now a way to build nice libraries and scroll them in netflix manner ...

here is mine ...

grafik

what do you think ? active on gh-pages...

@sy2002 now loading is even more faster and much more convenient ...

πŸ™Š my favourite games have all black background borders ... without our new persistent snapshot browser I would not have seen that...

run halt suspend resume

I implemented a halt/run button via the GUI. The previous code just implemented the run method with the known emscripten replacements for the pthread stuff. The halt method was simply doing nothing because it called pthread stuff which did nothing, in fact the thread variable p was always NULL and therefore halt did nothing... And therefore suspend did nothing and resume did nothing special too because the suspend counter was 0. The only thing the emulator did know how to do was run().

I wanted to change that ... because when browsing somewhere else taking a screen shot .. getting an incoming call you have to ... well ... halt!!!

first I did implement a proper halt replacement

void
C64::halt()
{
    if (isRunning()) {
    #ifdef __EMSCRIPTEN__
       emscripten_cancel_main_loop(); 
       ::threadCleanup(this);    
    #else
        // Cancel execution thread
        pthread_cancel(p);
        // Wait until thread terminates
        pthread_join(p, NULL);
    #endif

        // Finish the current command (to reach a clean state)
        step();
    }
}

so I called the emscripten counter part for pthread_cancel(p); which is emscripten_cancel_main_loop();

then to make suspend and resume work I had to fill the pthread p variable which the emulator takes for an indication whether it is halted or in running state.

bool
C64::isRunning()
{
    return p != NULL;
}

bool
C64::isHalted()
{
    return p == NULL;
}

void
C64::run()
{
    if (isHalted()) {
        
        // Check for ROM images
        if (!isRunnable()) {
            putMessage(MSG_ROM_MISSING);
            return;
        }
        
        // Power up sub components
        sid.run();
        
        // Start execution thread
        #ifdef __EMSCRIPTEN__
            p=1;   //<--------- use p here only as a flag 
            runThread((void *)this);
        #else
            pthread_create(&p, NULL, runThread, (void *)this);
        #endif
    }
}

the good thing halt run button from HTML GUI works brilliant ... CPU Load goes down from 60% to 9% and I got a still picture (on 2007 MacBookPro)

the bad thing disk drive got problems. I guess because it heavily using suspending/resuming before doing insert/prepareinsert and so on.

dropping a Disk and Load"$",8 looks like this
grafik

When change suspend an resume to do nothing all works as expected ... but I don't know for sure if this is the correct way ...


void
C64::suspend()
{
#ifdef __EMSCRIPTEN__
#else
    debug(2, "Suspending...(%d)\n", suspendCounter);
    
    if (suspendCounter == 0 && isHalted())
    return;
    
    halt();
    suspendCounter++;
#endif
}

void
C64::resume()
{
#ifdef __EMSCRIPTEN__
#else
    debug(2, "Resuming (%d)...\n", suspendCounter);
    
    if (suspendCounter == 0)
    return;
    
    if (--suspendCounter == 0)
    run();
#endif
}

Virtual touch joystick πŸ•Ή

We have now support for a virtual joystick πŸ•Ή
I found the one from @jeromeetienne very good. It worked without any modifications. His virtualjoystick is now fully supported. 😎✌️

I told rambo to exercise a testflight and although he is more in favor of the old analoge gear he said it was a pleasure to fly.

We made the following photo from the tower...

642DC955-B6CA-446E-A4B7-5305AECA799C

It will be enabled when selecting touch in game port

8365F8CF-72C9-44CD-A162-02F4D49AA119

CustomKeys and ActionScript

the user should be able to easily create custom overlay buttons with free positioning and a custom action command ... when clicking such a custom key very long it goes into drag mode where you can position it ... when releasing it after a long press it goes into edit mode where you can alter its appeareance like color, opacity and also its custom action ...

For the action of a custom key I thought of an action script which we can define when the button has been pressed during game play... for example

game example "BlueMax": to throw a bomb (press joystick2 down and fire throws the bomb)
j2fire1|j2down1|delay0.01|j2fire0||j2down0

because throwing a bomb makes the plane loosing height we correct this with
j2up1|delay0.1|j2up0

so the complete ActionScript would look like
ActionScript=j2fire1|j2down1|delay0.01|j2fire0||j2down0|j2up1|delay0.1|j2up0

game example "Spelunker": to fire dynamite ( press d for dynamite on the keyboard...)
ActionScript=keyd

this ActionsScript is very simple only one KeyCommand

because the customkey collection is game dependent ... it will be (automatically) stored and loaded under the title of a snapshot into a separate object store in the indexedDB ...

keyboard mapping

  1. F1 to F8 are not correctly mapped (only iOS, on a mac this works correctly)
  2. on a german keyboard Z and Y are swapped ...

revision of mach_time API replacements

some of the replacements are not very accurate now or even maybe wrong. This is so because in the beginning I did the replacements with brute force just in order to get it compiled. Then I was astonished that it runs so well. Now I feel we have to carefully revise these replacements ...

burger menu visible on mouse hover

on desktop I made the burger menu visible when the mouse pointer is placed near to it...

when burger menu is invisible and you want the navbar ...

BEFORE:
click somewhere (to make burger menu button visible)
move mouse to burger menu button
click the burger menu button

NOW:
move mouse to burger menu button
click the burger menu button

also there was a bug in resetting the time out value which makes the burger menu button invisible ... I corrected that too....

pushed to gh-pages

hope I did not break anything ...πŸ˜…

joystick connection properties

grafik

😎 now you are no longer stuck at
grafik

next I am heading for connecting the REAL joysticks ...😜

... but this games mission has to be completed first .. rambo has to save the world ... again

grafik

fixed design vs. scrollable

I need help in deciding a major app design point ...
should the web version have a fixed design like an typical app or be scrollable like a web site?

Currently it has a scrollable design. That is you can scroll vertically to make stuff at the bottom visible on small screens.

but we could make it fixed and give it the full window. Then for exampe we don't need the fullscreen button anymore because it is always fullscreen...

here some impressions...

grafik

the controls are also fixed to the bottom and they will not scroll either.. of course they must be made invisible when you don't want to use them.... and visible when you want to use them. Because there is no scolling anymore this could be done with a small icon in the left bottom corner for example.
And we should put them in a non opaque panel like the keyboard ...

popups would still work as before with the scrollable viewport.
grafik

grafik

grafik

πŸ™‹πŸΏI need advice and your brilliant minds ... to think the pros and cons ...

file dialog refinements

just did this ... an additional run option for disks ...

grafik

when both enabled
types
ENTER + load"*",8,1 + ENTER
and
ENTER + run + ENTER

Bug for all file types on iOS only:
when reinserting the same file a second time into file slot ... the file dialog does not appear ... only when changing to another second file and then the first again makes the file dialog appear ... πŸ™„

disk out and new disk in aka disk swap

this happens when I want to insert another disk after I played a game.

drop a disk into the drag drop zone
load"*",8,1
run
play
reset
drop another disk into the drag drop zone
load"$",8
Assertion failed: insertionStatus == NOT_INSERTED, at: C64/Drive/Drive.cpp,468,prepareToInsert

I guess I have to eject first ....

supercharge ready to type ...

currently ready to type depends on this code inside vc64_ui.js ...

        var faster_open_roms_installed = JSON.parse(wasm_rom_info()).kernal.startsWith("mega");
        if(reset_before_load == false)
        {
            //the roms differ from cold-start to ready prompt, orig-roms 3300ms and open-roms 250ms   
            var time_since_start=Date.now()-wasm_first_run;
            var time_coldstart_to_ready_prompt = faster_open_roms_installed ? 500:3400;
            
            if(time_since_start>time_coldstart_to_ready_prompt)
            {
                execute_load();
            }
            else
            {
                setTimeout(() => {  
                    execute_load();
                }, time_coldstart_to_ready_prompt - time_since_start);
            }
        }
        else
        {
            var time_reset_to_ready_prompt = faster_open_roms_installed ? 800:2800;
            
            $('#alert_reset').show();
            wasm_reset();
            setTimeout(() => {
                execute_load();
                $('#alert_reset').hide();
                reset_before_load=false;
            }, time_reset_to_ready_prompt);
        }
    }

since execution time could be interrupted on slow machines or while heavy computing takes place ... the time based approach is a rather not so robust ...

@dirkwhoffmann brought up a better and safer approach for the "ready to type" state of the Core ... and that is that the javascript can query the already executed cycles so far and make the assumption for the "ready to type state" based on that information rather then the passed time ...

should we interface to the c64 scene database ?

there is an iPhone app called C64 Scene 1.3.2 at https://csdb.dk/release/?id=171112

(I downloaded the source code, built it in xcode and deployed it on iPhone...)

B2DB7DBD-153A-4BA8-9591-30A490F2F011

E626AAAA-02CC-4542-9575-7DAE2AFDB478

712E2F74-3A51-4A22-B804-6180FC9D1D1A

A738C241-A7C6-409C-A6BE-4F46E231E0F1

which is a visual browser for iOS for all the stuff inside the csdb ... new demos are comming in regulary from the sceners ...

with it one can browse for the latest releases, the latest additions, top demos, etc ... and directly play them without to hassle with downloading files ....

I took a look into their source code ...

the source code points to a webservice for the list of different categories

https://csdb.dk/webservice/?type=latestrel
for latest releases

or

http://csdb.dk/webservice/?type=chart&ctype=release&subtype=2
for top demos

and more ...

strangely the download link is not directly provided in one list entry ... but an id

the ids in the list can be put into here to get https://csdb.dk/release/?id=123456
to get the download link of an entry ... (maybe there is also a simpler way for example an webservice to resolve the link with a webservice, I still have to dig deeper into the soure code ...)

But before looking deeper into this thing...

The question is: is it a good idea that we implement such an browser interface into vc64WE too ?

vc64 action script ... part 2

ok we have now the aim bot which is described at the end of part 1 ... but it is only working as expected when the sprite is sitting somewhere e.g. in the middle of the playing field...

unexpected behaviour is arising when we move our joystick to control the movements of the sprite ... our manual movement control actions is obviously interfering with the automatic aim bot code ...

example:

1.we turned the aimbot on
2.we are at the left our opponent is on the right side
3.we move our sprite down
4.the aimbot πŸ€– spots that we are on the same horizontal line as our opponent 😎
5.it aims and shoots: in this case it presses fire and pulls joystick to the right 😍
6. !!! 😱 now the interferring occurs, because we are manually still pulling the joystick downwards, the vc64core receives the aimbots fire press and the pull right and our manual pull down ...😳
7. the game reacts with shooting 45Β° right down ... not what we wanted πŸ™„

so to repair this I have the following idea:
we can connect the javascript to fetch the vc64cores controlports bitmask which do represent the current state of the joystick. wasm_joystick_state(port_nr)

then we alter the aimbot ...
at 4.
4.1 it should remember the current state of the joystick
4.3 it should release x_axis and y_axis...
5. do its aiming and shooting ...
5.1 restore the remembered joystick state ..

but maybe this is not so simple as it looks because between 4.3 and 5.1 the user could alter the joystick movements πŸ€” tricky ... any ideas ?

BOT API Framework ...

grafik

now that we have the stencil feature which is a present from virtualC64 V4 ... we can better analyse the playfield ... and drive our attention more to the important things of live and that is to win games ...

to make bot programming much more easy than now ... the idea is to write some classes which hide and abstract the computation of angles ... and only informs the bot class about important game events like "enemy is to your left" or "enemy diagonal right up of you" ...

class myBot extends Bot {
  incoming_event(event) {
      if( 1<event.other_sprite && event.other_sprite<7 )
      {
          aim_and_shoot(event.other_sprite);
      }
      if(event.other_sprite_position == 'left' || event.other_sprite_position == 'right')
      {
          move("down", 800); //move down 800ms
      }
  }
}
new myBot( sprite=0 ).run(port=1);  /* 0 is the sprite_id controlled by the bot*/


the self designed bot will extend the following base class which will give it the API to communicate and interact with ...


class Bot {
    constructor(sprite_id) 
//getter
    get x() 
    get y() 
    get port()

//methods
    distance(other_sprite)
    x(other_sprite)
    y(other_sprite)

    aim_and_shoot(other_sprite_id) 
    move(direction, time) 
    run(controller_port) 
}

game specifc joystick port selection has to be persisted

when the user selects a joystick port in a game lets say

pacman -> port 2
choplifter ->port 1

then vc64web has to remember that selection just like it currently does remember the action buttons for a specific game

when choosing a joystick port that selection has to be saved under the app / game title key in the indexedDB for later retrieval

then on another rainy day the user selects a snapshot of pacman
Result: it loads the snapshot and sets the joystick selection automatically to 2

the user selects a snapshot of pacman
Result: it loads the snapshot and sets the joystick selection automatically to 1

OMG: when this is done should we relabel virtualc64web to vc64AE (ArcadeEdition) then πŸ€” ? ... better not ... Arcade sounds not too serious ... (Are we serious ?πŸ•ΊπŸΎ Yes we are! 😎)

small bezel / wide screen option

... continued discussion from #42

looking at the pac man screen again ...

makes me believe that we need now a borderless option in the settings... to be modern and state of the art... Then the games will be even more immersive

Nobody want's bezels anymore today 😎... Don't really understand why they were so enormous popular back then ???

grafik

Acorn A4 sporting a powerful ARM3 processor

K/Board 84 keys with arrow keys
CPU ARM 3 (with 4 KB of internal RAM cache)
24 mHz (internal CPU) and 12 mHz (bus)
RAM   4MB
ROM   2 MB
Text: Max : 132 x 30
Graphics: 47 graphic modes, maximum 640 x 480 with LCD screen and up to 1152 x 896 with VGA screen
Screen 14 shades of grey (LCD screen)
Sound: 8 voices (stereo 8 bit)
I/O Ports: VGA, Centronics, RS232 C, stereo sound, Mouse, Keyboard
Drive: 3.5'' disk-drive
OS: RISC OS
Cost: Β£1395 (2Mb floppy version) up to Β£1895 (4Mb HD120 version)

Manufacturer: Acorn
Date: 1992

support for favourites in the collector interface

grafik

the csdb is endless (187796 entries inside) so we want to set "hearts" to our favourites and to be able to show favourites only when we like to ... 😎

this will be the next feature of vc64web ... stay tuned 😍

icon library

to make the UI more appealing we should use svg icons instead of text .... I tried some and it looks very nice ...

I really like this .. it is recommended on the bootstrap site... its only 45kb for all the icons ...

https://useiconic.com/open/

... can we simply use it ?

I am not sure about the license ... seems to be free to use, but I am not an expert...

https://useiconic.com/license/

or should we use another icon library ?

We should have a settings wheel icon a run and pause icon and a fullscreen icon and a keyboard icon. And a camera icon for snapshots.

Or can we use the icons from the native virtualc64?

Space on an iPhone or iPad

03A23913-CAF0-44E8-8DE1-9F562E57C410

Here you see me on a 6s plus controlling the heli with a bluetooth keyboard in fullscreen (ALT+ENTER)

Everything is good. But in NON-fullscreen
The space key scrolls the screen down ... must be a specific iOS feature...

A3CC5E8A-0803-4367-9DB4-8832B508B789

directly after booting up .. make the nav bar visible

currently the nav bar is not visible directly after booting up ... only on clicking the burger menu it shows up ...

make it visible right after the startup because the user in any case (ok most likely .. 99% ...) wants to do something with the navbar ... ok ok ... right .. except the rare case the user wants to code basic right away πŸ€“

new v4 restore snapshot 20 second mute bug

before take snapshot 
  wrapper->c64->sid._dumpConfig();
  wrapper->c64->sid._dump(0);

 
 
 Chip revision : 1 ((null))  
   Enable mask : 1  
       Address : 0 0 0  
        Filter : no  
        Engine : 1 ((null))  
      Sampling : 0 ((null))  
Channel volume : 100 0 0 0  
 Master volume : 100 0  
ReSID:  
------  
    Chip model: 1 ((null))  
 Sampling rate: 43735.000000  
 CPU frequency: 985249  
Emulate filter: yes  
<empty string>  
        Volume: 15  
   Filter type: NONE  
Filter cut off: 0  
<empty string>  
Filter resonance: 0  
<empty string>  
Filter enable bits: 0  
<empty string>  
Voice 0:       Frequency: 8583  
             Pulse width: 0  
                Waveform: SAW  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 0  
            Release rate: 0  
Voice 1:       Frequency: 65535  
             Pulse width: 3520  
                Waveform: NOISE  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 10  
            Release rate: 10  
Voice 2:       Frequency: 8583  
             Pulse width: 3520  
                Waveform: SAW  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 10  
            Release rate: 10  
FastSID:  
--------  
    Chip model: 1 ((null))  
 Sampling rate: 43735.000000  
 CPU frequency: 985249  
Emulate filter: yes  
<empty string>  
        Volume: 15  
   Filter type: NONE  
Filter cut off: 0  
<empty string>  
Filter resonance: 0  
<empty string>  
Filter enable bits: 0  
<empty string>  
Voice 0:       Frequency: 8583  
             Pulse width: 0  
                Waveform: SAW  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 0  
            Release rate: 0  
Voice 1:       Frequency: 65535  
             Pulse width: 3520  
                Waveform: NOISE  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 10  
            Release rate: 10  
Voice 2:       Frequency: 8583  
             Pulse width: 3520  
                Waveform: SAW  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 10  
            Release rate: 10  
vC64 message=MSG_USER_SNAPSHOT_TAKEN, data=0







--------------------- coldstart and load snapshot  
 wrapper->c64->sid._dumpConfig();
 wrapper->c64->sid._dump(0);

load file=falcon_patrol_2xxxx.zip.vc64 len=2185858, header bytes= 56, 43, 36 
isSnapshot
vC64 message=MSG_SNAPSHOT_RESTORED, data=0 
 Chip revision : 1 ((null))  
   Enable mask : 1  
       Address : 0 0 0  
        Filter : no  
        Engine : 1 ((null))  
      Sampling : 0 ((null))  
Channel volume : 100 0 0 0  
 Master volume : 100 0  
ReSID:  
------  
    Chip model: 1 ((null))  
 Sampling rate: 44100.000000  
 CPU frequency: 985249  
Emulate filter: yes  
<empty string>  
        Volume: 0  
   Filter type: NONE  
Filter cut off: 0  
<empty string>  
Filter resonance: 0  
<empty string>  
Filter enable bits: 0  
<empty string>  
Voice 0:       Frequency: 0  
             Pulse width: 0  
                Waveform: NONE  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 0  
            Release rate: 0  
Voice 1:       Frequency: 0  
             Pulse width: 0  
                Waveform: NONE  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 0  
            Release rate: 0  
Voice 2:       Frequency: 0  
             Pulse width: 0  
                Waveform: NONE  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 0  
            Release rate: 0  
FastSID:  
--------  
    Chip model: 1 ((null))  
 Sampling rate: 44100.000000  
 CPU frequency: 985249  
Emulate filter: yes  
<empty string>  
        Volume: 15  
   Filter type: NONE  
Filter cut off: 0  
<empty string>  
Filter resonance: 0  
<empty string>  
Filter enable bits: 0  
<empty string>  
Voice 0:       Frequency: 8583  
             Pulse width: 0  
                Waveform: SAW  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 0  
            Release rate: 0  
Voice 1:       Frequency: 65535  
             Pulse width: 3520  
                Waveform: NOISE  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 10  
            Release rate: 10  
Voice 2:       Frequency: 8583  
             Pulse width: 3520  
                Waveform: SAW  
         Ring modulation: no  
               Hard sync: no  
             Attack rate: 0  
              Decay rate: 0  
            Sustain rate: 10  
            Release rate: 10  
wasm_run

next goal is to interconnect the cores snapshot feature

We want to manual save snapshots or use the automatic snapshots feature of the vc64 core.
We want to visualize the local saved snapshots beautiful. Maybe we can use https://www.w3schools.com/bootstrap4/bootstrap_carousel.asp for it ?

We want to easily select a snapshot and go back in time 😎 ...

we can persist snapshots possibly with one of the following APIs directly into the browsers local storage...

maybe other ideas ?

project optimising the GUI

this should be a series of improvements to the existing UI, before doing the next step which is implementing vAmigaWeb

we start with this ...

UI-issue: csdb/snapshot browser was not responsive when using Phones in portrait orientation

BEFORE
grafik

AFTER
grafik

😎

upgraded to progressive web app (PWA)

until today we had a normal web appπŸ€— .. which meant

  • that the code was loaded from the webserver (slow)...
  • no offline mode
  • no icons when saved to homescreen
  • annoying poping up adress bar (on mobile)
  • annoying scrolling of the emulator canvas (on mobile)
  • annoying swipe gestures (page back and page forward)

now vc64web has been upgraded to a progressive web app and qualifies as a PWA 😎 .... (yes latest technology)

BEFORE:

grafik

FROM NOW ON:

grafik

what does that mean ....

  1. when saved to homescreen app starts instantly from the app cache ... it is not anymore loaded from web server (yes it starts offline like a real app) (fast)
  2. has dirks app icon on the homescreen (mobile only)
  3. no scrolling of the emultore canvas anymore (mobile only)
  4. no adressbar poping in and distracting the user (mobile only)
  5. in iOS behaves like a own app ... that means you see it in the taskswitcher as an own app (not a webpage in the safari.app)

we are using now the following local browser storages types ...

  • Local Storage for settings and the rom files (limit on iOS 5mb)
  • IndexedDB for the persistent snapshots (limit on iOS 1GB)
  • Cache Storage for the installation files of the app (compiled c/c++ wasm code and so on...) (limit on iOS 50MB)

When the app is NOT saved to the iOS home screen (only used in safari) these storages will be deleted automatically if the app has not been used for 7 to 14 days.

grafik

That means it behaves now like a real app ...😎 well in theory it should ... I have not tested every browser yetπŸ€“ any problems please report them here ...

Ehhm yes ... and the 512x512 icon is missing ... dirk ? do you have one otherwise a have to upscale from a smaller one ?

going responsive and making some glitter

I played a bit with a minimalistic css framework called skeleton it only consists of two files with the size of a few Kb and no Javascript.
grafik

and on a small device
grafik

But maybe when we do the snapshot storaging we need some more nice looking gui components like alerting or short modal messages/dialogs .

We should maybe better go for a css framework with more and richer components like bootstrap...

I have found another cool framework which gives it a retro look ... it is called NES.css but it is a bit too NES like ... no?

ideas for project setup ?

I have committed the original unmodified C64 emulator dir from virtualC64 into the master of the virtualc64web. πŸ₯³

I did chose to not commit the last working modded C64 with running octopus into master by intention. Because I think we need to have the history of patches I already have applied (without git ) to the precious original core. I feel this is important because in case of any problems (my toxic mach_time_functions replacments, etc..😷😷😷) we can trace all modififications made to it and improve them.

Next I have made a new branch dev where I have commited all mods to C64 with running octopus. I am still at it and it is not ready to merge into master. Like to finish and cleanup the dev branch in the coming days. (Also I used a wrong author-name "Baba" 😱at one single commit in the dev branch, ... git username was wrong in git config in one of my machines ... also like to repair this.)

In github you can already compare dev to master to see the current applied mods. I also made a v0.0 Release so in future we can always compare all coming mods to the baseline version v0.0.

After "inserting" a disk, the font changes and the system behaves strange

After I inserted the disk of one of my favorite games (download here, link will expire on 11th of June), I was not able to type any more. Here you see what happened, after I tried to type "load" (first line):

grafik

I am using this very same D64 with the macOS version of vc64 and there it works fine.

Here is a video capture, how this looks on my computer: Download Link (expires 11th of June).

The strangest thing is: Even though I can reproduce this pretty regularly, it does not always happen. Once, I was able to do a load"$",8 and see the directory, but when I then tried to load the main file, the loading took forever and never stopped.

My setup: MacBook Pro, macOS 10.14.6, Firefox 76.0.1. (Had no time, yet to check on Chrome and Safari)

After restoring Giana Sisters snapshot, music stutters

How to reproduce (I tested on macOS 10.14.6 and Firefox 78.0.1):

  1. Load "*",8,1 and run from this disk: The Great Giana Sisters.D64.zip

  2. Work your way through the Cracktro (choose "Highscore Loader")

  3. Enjoy 2 to 3 seconds of the intro music of Giana Sisters in the main screen

  4. Make a snapshot

  5. Close your Browser

  6. Open the Emu again and restore the snapshot

  7. Listen to strange/wrongly timed music (which after a while normalizes)

Example: Listen to the recording I attached, it contains the strange (wrongly timed) music directly after the restoring of the snapshot: strange-music.m4a.zip

load some floppies ...

grafik

octopus in red 😎 loaded with the new introduced html5 file dialog

loading individual PRG files is fine, but the other types like CRT files and so on are not working yet, maybe I did something wrong in the code below ? I just guessed from the virtualC64 API names what could be appropriate and called that guys but nothing special happens ...


  if (checkFileSuffix(name, ".D64") || checkFileSuffix(name, ".d64")) {
    printf("isD64\n");
    //wrapper->c64->flash(D64File::makeWithBuffer(blob, len),0);
    wrapper->c64->drive1.insertDisk(D64File::makeWithBuffer(blob, len));
  }
  else if (checkFileSuffix(name, ".G64") || checkFileSuffix(name, ".g64")) {
    printf("isG64\n");
    wrapper->c64->drive1.insertDisk(G64File::makeWithBuffer(blob, len));
  }
  else if (checkFileSuffix(name, ".PRG") || checkFileSuffix(name, ".prg")) {
    printf("isPRG\n");
    wrapper->c64->flash(PRGFile::makeWithBuffer(blob, len),0);
  }
  else if (checkFileSuffix(name, ".CRT")|| checkFileSuffix(name, ".crt")) {
    printf("isCRT\n");
    wrapper->c64->expansionport.attachCartridge( Cartridge::makeWithCRTFile(wrapper->c64,(CRTFile::makeWithBuffer(blob, len))));
  }


Sound

I just listened to the sound of octopus in red wine in firefox. Oh my god it really works πŸ™ˆ. I made a branch sound for it. πŸ₯πŸŽ»πŸŽΊπŸŽΈπŸͺ•

pixel art mode

we have a brand new setting

pixel art on/off 😎✊🏿

grafik

grafik

grafik

grafik

firefox ✌️
chrome ?
safari ... unfortunately it does not work in safari 😭 ... yet .. the canvas does not accept the image-rendering attribute ... maybe a bug in safari ? in general safari knows this attribute !! on the snapshot canvas elements for example it works...

here on snapshot ... manually set left most snapshot canvas on safari to image-rendering: crisp-edges; ... which works ... same attribute on emulator canvas shows no effect 😬 ....
grafik

I followed this description here https://developer.mozilla.org/en-US/docs/Games/Techniques/Crisp_pixel_art_look

optimizing and reducing energy impact

I have several improvements in the queue ... this time energy ... still looking ahead for the vAmigaWeb ... which needs optimisations even more ...

Removal of that pixel rendering method via the windowsurface
in case the host does not support hardware accelerated GPU texture rendering we will notice this now and fall back to a software texture renderer... So we got max. performance and high compatibility

Energy impact
currently the mainloop is called 60 times in a second, hence 60fps ...
it calls 60 times in a second c64->executeOneFrame(); is that neccessary ?
and 60 times in a second it loads the screenbuffer c64->vic.screenBuffer(); into the GPU
and draws it 60 times per second onto the screen

When we modify the drawOneFrameIntoSDL() method so that it skips every second frame so that it effectively renders 30 fps and it still looked the same as the 60 fps version 😎...

By lowering to 30fps we save approximately half the CPU activity hence energy πŸ€“... The fans of my oldest machine do not turn on anymore 😍

When we let run c64->executeOneFrame(); 60 fps but only render the screenbuffer 30 fps then it saves still one third ... which is also great !πŸ€—

I like to know how that is that handled in virtualC64? What is the recommended min. fps ? Is it valid to go by 30 fps only ? Am I eligable to do what I do ?... Sprite movments in fort apocalypse where absolutely smooth ...

DMA Visualizer

grafik

I did this c64->configure(OPT_DMA_DEBUG, true);

but the visualization is fairly static ... it does not change ... am I holding it wrong ?

grafik

oh the paparazzi took a photo of us πŸ™„ ... me left ... dirk on the right side... πŸ€“

vc64 action script ... the journey begins ...

vc64 insider rumors and more ...

Evidence growing for late September 2020 release of action script based systems ... some guys who knowing more than us told us ... there are brand new rumors which claim that vc64web will get finally vc64 action script β„’ πŸ‘€ we here at vc64 insider rumors ... of course can't wait to get our hands on the real working system 🀀...

What to expect from this new feature... it is still said to be in design phase but
here are already some "maybe confidential" pictures which are supposed to be directly from a development system of the vc64 team ... 😍

grafik

here someone from the devs clicked or touched the add button ....πŸ™ƒ

grafik

or another one

grafik

when everything gets right the rumors claim that we will likely get our hands on the first beta already in september 🀀🀀🀀...

Our source reporter Zak McKracken has a relatively good record for product leaks, as well as being particularly prolific with details. If something changes he promised to give us a tweet...

78D0A6FD-BF3A-41EA-900A-1574BA4AFB70

Missing cartridges

I'd like to expand the range of supported cartridges in v4.0 a bit. For doing this, I am looking for the following cartridges in form of .crt files:

  • Moonspire
  • GameKiller

Maybe someone can help out (without posting them here).

BTW, v4.0 will support cartridges of type "Dinamic" (which is an extremely simple cartridge, to be honest):

Bildschirmfoto 2020-09-15 um 17 16 19

should we have a darkmode switch ?

someone told me once about the art of PISDM(TM) (Priority Inversion Software Development Method) aka LITF: least important things first πŸ‘πŸΌ
... I wanted to try this too 😎 ... therefore I thought of the least important thing which vc64web needs now ... which I think πŸ€” is a ... darkmode switch ...

here are some impressions of the hack ...

grafik

grafik

grafik

grafik

I don't know now whether I should commit or discard the dark mode switch ? Because it is just so unimportant...

Suggestion: Filter/Reduce Bus-Log

I forced a situation, where the disk led is blinking and therefore my point can me made very "graphically" :-) Please look at the following image: The bus-log is being spammed with hundrets or even thousands of "disk led blinking" bus messages. This has two disadavantages:

  1. You cannot see "important" debug messages

  2. Browsers tend to become slower, the more content these kind of text boxes are having. That means, that the web version of virtualC64 will become slower and slower the longer it runs. Uncool for a long session of Giana Sisters ;-)

grafik

Suggestion: You might want to filter certain messages and/or switch this log off by default and only on on demand.

reset not working in some cases

it happend when something did go completely wrong ... for example changing roms during gameplay or so ... but this is hard to reproduce.

now I have found a case which is reproducable:

  1. run square booze demo

grafik

  1. open virtual keyboard type run-stop + restore

  2. press reset button in the navbar

grafik

  1. now the emulator is completely frozen ...

sidenotes:

  • it happens with both types of roms e.g. original roms and open roms
  • pressing reset again changes nothing ... still hangs
  • it works in the 3.4 version

modal dialog to load roms via file dialog and save them to the browsers local storage

The plan: when roms folder is empty the core will notify the javascript part that it needs roms to start ... the javascript part looks into local storage if it can find the roms there and when it does not find them then it invokes a modal dialog asking the user for help. The user can then select the rom files with the file dialog and the javascript part saves them for later use into the local storage. On subsequent visits the user has not to be bothered again as the roms are already in the browsers local storage ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.