News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

.

Started by Phi2x, 18:49, 09 September 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gryzor

Quote from: phi2x on 20:37, 24 September 12
I agree it would be cool to have touchscreen controls, but it's not high priority for me now.



Nah, not really. Even games specifically designed for touch controls can't pull it off most of the times...

Phi2x

#451
.

Gryzor

Indeed. The only games I've found that I really enjoy and play again and again are either very simple ones, control-wise (like Canabalt) (or, even better, I must run!), or needing just simple clicks like defense titles (Anomaly Warzone Earth FTW!). All the other control styles - I've played some games that would have been fantastic on a pc with physical input devices, but dropped them within minutes on my mobile.

Phi2x

#453
.

Devilmarkus

Since you swapped the initial display size to the largest possible on the page, its very slow now.
(~30fps)
I am using Firefox 16.0.2
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

Phi2x

#455
.

Devilmarkus

I always have the latest display drivers installed.

I use an ATI Radeon HD 5570. Would be crazy when it would be blacklisted...
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

Prodatron

Btw, the actual CPCBOX Version runs fine on my Android Smartphone (Samsung Note II) in Firefox with about 12fps  :) Thats not bad for a mobile I guess. It doesnt run with Chrome or the standard browser because of a missing Html5 Api.
I just have to fins out how to activate the touchscreenkeyboard...

CU,
Prodatron

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Phi2x

#458
.

Phi2x

#459
.

Phi2x

#460
.

Devilmarkus

How stupid: My gfx driver was 1 rev. older than the actual... (I had rev. 12.9 and actual is 12.10)
And it had been blacklisted...
What a lousy crap :-D
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

Phi2x

#462
.

Gryzor

Nice, we <3 tapes. Does it also play the sound?

Devilmarkus

Got trouble with the keyboard.
It's AZERTY now?!?

Only when I change my kb-translation to FR it works ok...
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

Phi2x

#465
.

Phi2x

#466
.

Devilmarkus

#467
In JavaCPC (Java is also weird with keycodes etc...) I coded a KeyTranslator class, which changes the required KeyEvents:

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jemu.ui;

import java.awt.event.KeyEvent;

/**
*
* @author Markus
*/
public class KeyTranslator {

    protected boolean DEBUG = false;

    public KeyEvent translate(KeyEvent g, String localkeys) {
        KeyEvent e = g;
        // Special CPC keys
        if (e.getKeyLocation() != 1) {
            // small enter key
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                e.setKeyCode(KeyEvent.VK_END);
            }
            // F-Key mapping (When joystick is off)
            if (Switches.joystick != 1) {
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD0) {
                    e.setKeyCode(KeyEvent.VK_F12);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD1) {
                    e.setKeyCode(KeyEvent.VK_F1);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD2) {
                    e.setKeyCode(KeyEvent.VK_F2);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD3) {
                    e.setKeyCode(KeyEvent.VK_F3);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD4) {
                    e.setKeyCode(KeyEvent.VK_F4);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD5) {
                    e.setKeyCode(KeyEvent.VK_F5);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD6) {
                    e.setKeyCode(KeyEvent.VK_F6);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD7) {
                    e.setKeyCode(KeyEvent.VK_F7);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD8) {
                    e.setKeyCode(KeyEvent.VK_F8);
                }
                if (e.getKeyCode() == KeyEvent.VK_NUMPAD9) {
                    e.setKeyCode(KeyEvent.VK_F9);
                }
            }
        }

        // german keyboard mapping
        if (localkeys.equals("DE_DE")) {
            if (DEBUG) {
                System.out.println("DE: " + e.getKeyChar());
            }
            if (e.getKeyChar() == '\u00FC' || e.getKeyChar() == '\u00DC') {
                e.setKeyCode(KeyEvent.VK_OPEN_BRACKET);
                return e;
            }
            if (e.getKeyChar() == '\u00E4' || e.getKeyChar() == '\u00C4') {
                e.setKeyCode(KeyEvent.VK_QUOTE);
                return e;
            }
            if (e.getKeyChar() == '\u00F6' || e.getKeyChar() == '\u00D6') {
                e.setKeyCode(KeyEvent.VK_SEMICOLON);
                return e;
            }
            if (e.getKeyChar() == '\u00DF' || e.getKeyChar() == '\u003F') {
                e.setKeyCode(KeyEvent.VK_MINUS);
                return e;
            }
            if (e.getKeyCode() == 0x2d) // - key to /
            {
                e.setKeyCode(KeyEvent.VK_SLASH);
                return e;
            }

            if (e.getKeyCode() == 0x81) // ß key to ^
            {
                e.setKeyCode(KeyEvent.VK_EQUALS);
                return e;
            }
            if (e.getKeyCode() == 0x99) // <> key to [
            {
                e.setKeyCode(KeyEvent.VK_ALT_GRAPH);
                return e;
            }
            if (e.getKeyCode() == 0x82) // ^ key to TAB
            {
                e.setKeyCode(KeyEvent.VK_TAB);
                return e;
            }
            if (e.getKeyCode() == 0x208) // # key to \
            {
                e.setKeyCode(KeyEvent.VK_BACK_SLASH);
                return e;
            }
            if (e.getKeyCode() == 0x209) // + key to ]
            {
                e.setKeyCode(KeyEvent.VK_CLOSE_BRACKET);
                return e;
            }

            if (e.getKeyCode() == KeyEvent.VK_Z) // change Z to Y
            {
                e.setKeyCode(KeyEvent.VK_Y);
                return e;
            }
            if (e.getKeyCode() == KeyEvent.VK_Y) // and Y to Z
            {
                e.setKeyCode(KeyEvent.VK_Z);
                return e;
            }
        }
        // german mapping end

        // spanish keyboard mapping
        if (localkeys.equals("ES_ES")) {
            if (DEBUG) {
                System.out.println("ES: " + e.getKeyChar());
            }
            if (e.getKeyChar() == '\u00BA' || e.getKeyChar() == '\u00B2') {
                e.setKeyCode(KeyEvent.VK_TAB);
                return e;
            }
            if (e.getKeyChar() == '\u00E7' || e.getKeyChar() == '\u00C7') {
                e.setKeyCode(KeyEvent.VK_BACK_SLASH);
                return e;
            }

            if (e.getKeyChar() == '\u00D1' || e.getKeyChar() == '\u00F1') {
                e.setKeyCode(KeyEvent.VK_SEMICOLON);
                return e;
            }
            if (e.getKeyCode() == 0xde) {
                e.setKeyCode(KeyEvent.VK_MINUS);
                return e;
            }
            if (e.getKeyCode() == 0x2d) // - key to /
            {
                e.setKeyCode(KeyEvent.VK_SLASH);
                return e;
            }
            if (e.getKeyCode() == 0x81) {
                e.setKeyCode(KeyEvent.VK_QUOTE);
                return e;
            }
            if (e.getKeyCode() == 0x209) // + key to ]
            {
                e.setKeyCode(KeyEvent.VK_CLOSE_BRACKET);
                return e;
            }

            if (e.getKeyCode() == 0x206) {
                e.setKeyCode(KeyEvent.VK_EQUALS);
                return e;
            }
            if (e.getKeyCode() == 0x99) {
                e.setKeyCode(KeyEvent.VK_ALT_GRAPH);
                return e;
            }
            if (e.getKeyCode() == 0x80) {
                e.setKeyCode(KeyEvent.VK_OPEN_BRACKET);
                return e;
            }
        }
        // spanish mapping end

        // french keyboard mapping
        if (localkeys.equals("FR_FR")) {
            if (DEBUG) {
                System.out.println("FR: " + e.getKeyChar());
            }
            // ,;:=
            if (e.getKeyCode() == 515) {
                e.setKeyCode(KeyEvent.VK_CLOSE_BRACKET);
                return e;
            } else if (e.getKeyCode() == 130) {
                e.setKeyCode(KeyEvent.VK_OPEN_BRACKET);
                return e;
            } else if (e.getKeyCode() == 57) {
                e.setKeyCode(KeyEvent.VK_9);
                return e;
            } else if (e.getKeyCode() == 522) {
                e.setKeyCode(KeyEvent.VK_MINUS);
                return e;
            } else if (e.getKeyCode() == KeyEvent.VK_Q) {
                e.setKeyCode(KeyEvent.VK_A);
                return e;
            } else if (e.getKeyCode() == KeyEvent.VK_A) {
                e.setKeyCode(KeyEvent.VK_Q);
                return e;
            } else if (e.getKeyCode() == KeyEvent.VK_Z) {
                e.setKeyCode(KeyEvent.VK_W);
                return e;
            } else if (e.getKeyCode() == KeyEvent.VK_W) {
                e.setKeyCode(KeyEvent.VK_Z);
                return e;
            } else if (e.getKeyChar() == '\u00B2' || (e.getKeyCode() == 0 && (int) e.getKeyChar() == 65535)) {
                e.setKeyCode(KeyEvent.VK_BACK_SLASH);
                return e;
            } else if (e.getKeyChar() == '\u0025' || e.getKeyChar() == '\u00F9') {
                e.setKeyCode(KeyEvent.VK_QUOTE);
                return e;
            } else if (e.getKeyCode() == 151) {
                e.setKeyCode(KeyEvent.VK_ALT_GRAPH);
                return e;
            } else if (e.getKeyCode() == 77) {
                e.setKeyCode(59);
                return e;
            } else if (e.getKeyCode() == 44) {
                e.setKeyCode(77);
                return e;
            } else if (e.getKeyCode() == 59) {
                e.setKeyCode(44);
                return e;
            } else if (e.getKeyCode() == 517) {
                e.setKeyCode(KeyEvent.VK_SLASH);
                return e;
            } else if (e.getKeyCode() == 513) {
                e.setKeyCode(KeyEvent.VK_PERIOD);
                return e;
            }
        }
        // french mapping end
        return e;
    }
}


I call it every key press and key release.
E.g.:
public void KeyPressed(KeyEvent e){
    translator.translate(e, localkeys);
    computer.handleKeyEvent(e);
}


Works fine ;)
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

Phi2x

#468
.

Devilmarkus

Hmmm sad... I hoped my code was helpful :(
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

Phi2x

#470
.

Phi2x

#471
.

SyX

It's amazing how far your project has come phi2x. Congratulations!!! :)

The first versions were practically unusable in my computer, now i get a solid 50fps (although in full-screen mode only 30 fps :P) and of course, the most accurate cpc emulator (great Z80, pixel perfect rasters, ... :) ), so accurate that these days CPCBox is my last test, before checking in the real machine.

I think that you will be interested in the new ZEXALL test (faster and with tests for the recently discovered CCF/SCF flags) that Patrik Rak is working, you can see more info in this thread.


Prodatron


GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

db6128

Quote from: SyX on 22:23, 07 December 12I think that you will be interested in the new ZEXALL test (faster and with tests for the recently discovered CCF/SCF flags) that Patrik Rak is working, you can see more info in this thread.
Jeez... The Z80 is a great little device, but things like that just seem unnecessarily complex and obscure. ;) But I'm definitely glad there are people who care that much about accuracy.

Quote from: Patrik RakWell, if we are lucky, it will behave in such a way that single bit is enough to represent this state. OTOH, when you consider how F register works, it would make sense if there was some place to assemble new F, and then just store it to F. The way how F is paired with A for PUSH/POP AF and EX AF,AF' furthermore makes F seem like an ordinary register, so having another place for flag assembly makes sense.
I really wish F was an ordinary register. Can you tell I'm kinda running out of spares at the moment? :D
Quote from: Devilmarkus on 13:04, 27 February 12
Quote from: ukmarkh on 11:38, 27 February 12[The owner of one of the few existing cartridges of Chase HQ 2] mentioned to me that unless someone could find a way to guarantee the code wouldn't be duplicated to anyone else, he wouldn't be interested.
Did he also say things like "My treasureeeeee" and is he a little grey guy?

Powered by SMFPacks Menu Editor Mod