CPCWiki forum

General Category => Emulators => Topic started by: Devilmarkus on 00:44, 20 January 13

Title: GX4000 online-emulation
Post by: Devilmarkus on 00:44, 20 January 13
I'm working on a GX4000 emulator, which already has all 25 known cartridges included.
Complete size is ~2.08mb incl. all games.

You can give it a try here:
Applet HTML Page (http://cpc-live.com/GX4000.html)

- Select a game: Click a button below or click the "Power" button on the monitor.
- Fullscreen: ALT + ENTER toggles. (When turning back from fullscreen to applet mode, the display maybe is moved. Minimize your browser then and bring it back to front)
- Reset: F12
- Define keys for GX4000 gamepad: F10

Emulation is better now, and accurate enough to play all cartridges.
Skeetshot is included but not playable because no lightgun emulation.
Title: Re: GX4000 online-emulation
Post by: TotO on 11:42, 20 January 13
Great first CPC+ online ! :)


On my computer, I get the display redraw problem (java double buffer ?) and the sound play with crash.
But, may be look ok for others?

Title: Re: GX4000 online-emulation
Post by: Phi2x on 13:17, 20 January 13
.
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 13:21, 20 January 13
Simple: Firefox warns on ALL applets you find in the web.
Activate it or leave it.

[sarkasm]No, I included spyware, which only harms your computer[/sarkasm]

Really, there's nothing special.

When done, I will change it to open source.
Title: Re: GX4000 online-emulation
Post by: Phi2x on 13:38, 20 January 13
.
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 14:52, 20 January 13
Yeah I know...
Executioner is also fucked actually.
JEMU - The Java Emulation Platform (http://jemu.winape.net/)

The selectors for System/Game don't feed on <body onload...

This happens because the applet is also blocked first.

But, AFAIK, he's already working on a solution. (Javascript timer which watches applet state)
Title: Re: GX4000 online-emulation
Post by: Sykobee (Briggsy) on 23:03, 20 January 13
I can't get the key redefinition to work - I see the gamepad, and I can click on the keys to redefine and it will ask me to do so, but it doesn't pick up anything I enter.


Any chance of having a default keyboard mapping enabled by default - WASD <space> <enter> maybe?
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 00:22, 21 January 13
WASD,space,enter is a bad default as the emulator is also designed to emulate the CPC+ later.
Sure, it doesnt show your keyboard input?

What OS are you running?

Edit: Should be solved now. I replaced the applet.
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 21:24, 21 January 13
Now with Trojan Lightgun-emulation:

Applet HTML Page (http://cpc-live.com/GX4000.html)

Press "Scroll lock" to enable/disable lightgun emulation.

(Or press F10 to setup the controller... There you can also enable lightgun) Thanks to TotO who has no Scroll lock key :P

Does not work in fullscreen (yet) !!!!

But in simple and fullsize works fine.

So enjoy playing Skeetshot and The Enforcer ;)
Title: Re: GX4000 online-emulation
Post by: Sykobee (Briggsy) on 22:37, 21 January 13
Working great now!
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 22:48, 21 January 13
Great!
The problem was the label where I show the controller picture.
It was "focusable" -> removed that.
Title: Re: GX4000 online-emulation
Post by: TFM on 06:12, 22 January 13
Well done! Great work! The best Emulator online!
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 11:53, 23 January 13
I was almost going mad when coded the lightpen emulation, too.

In the guide for the DK'Tronics Lightpen (http://www.cpcwiki.eu/index.php/Dk%27tronics_Lightpen) is a bug:

bad:

10 out &1C00, 17 : L=inp(&1F00) : out &1C00, 16 : H=inp(&1F00)
20 L=H*256+L-12292 : Y=L/40 : X=L-Y*40


correct:

10 out &1C00, 17 : L=inp(&1F00) : out &1C00, 16 : H=inp(&1F00)
20 L=H*256+L-12292 : Y=INT(L/40) : X=L-Y*40


Result:
Spoiler: ShowHide
(http://cpc-live.com/lightpen2.gif) (http://cpc-live.com/lightpen2.gif)


Spoiler: ShowHide
(http://cpc-live.com/lightpen.gif) (http://cpc-live.com/lightpen.gif)
Title: Re: GX4000 online-emulation
Post by: robcfg on 12:19, 23 January 13
Congratulations!


The silliest bugs are the most difficult to find, glad you managed to solve it!
Title: Re: GX4000 online-emulation
Post by: Bryce on 14:05, 23 January 13
Quote from: Devilmarkus on 11:53, 23 January 13
I was almost going mad when coded the lightpen emulation, too.

In the guide for the DK'Tronics Lightpen (http://www.cpcwiki.eu/index.php/Dk%27tronics_Lightpen) is a bug:

bad:

10 out &1C00, 17 : L=inp(&1F00) : out &1C00, 16 : H=inp(&1F00)
20 L=H*256+L-12292 : Y=L/40 : X=L-Y*40


correct:

10 out &1C00, 17 : L=inp(&1F00) : out &1C00, 16 : H=inp(&1F00)
20 L=H*256+L-12292 : Y=INT(L/40) : X=L-Y*40


Result:

That's more accurate than the real one was :D

Ignoring the fact that you had to turn up the brightness until the screen image was actually being permanently burnt onto the surface of your eyes. The pointer used to jump all over the place, even when you held the pen steady on one spot.

Bryce.
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 14:15, 23 January 13
I combine both now: Lightpen and lightgun emulation.
Lightgun is active on default.
When you click left mouse button it acts as fire.

When you click right mouse button, Lightpen is pushed to the screen and the cursor moves.
In lightpen mode the left mouse button acts as enter key.

Demo video:
Lightpen emulation for JavaCPC (http://cpc-live.com/dklightpen/)
Title: Re: GX4000 online-emulation
Post by: Gryzor on 15:09, 23 January 13
Quote from: BryceThat's more accurate than the real one was 

Ignoring the fact that you had to turn up the brightness until the screen image was actually being permanently burnt onto the surface of your eyes. The pointer used to jump all over the place, even when you held the pen steady on one spot.

Bryce.
Yeah... when I got one a few years back I had a hard time deciding whether it was just a crappy product or a faulty unit...
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 16:01, 23 January 13
Question is now:
Who has a Trojan Lightgun (Old CPC/ CPC+)
I need some informations:

When you pull the trigger, it returns the read value from CRTC (x,y position + memory base)

But what does it return, when you don't pull the trigger?
To test:
10 OUT &BC00,16:A=INP(&BF00):OUT &BC00,17:B=INP(&BF00):PRINT A;B

Is anyone here who could do this test?
Title: Re: GX4000 online-emulation
Post by: TFM on 22:35, 24 January 13
Quote from: Devilmarkus on 11:53, 23 January 13
I was almost going mad when coded the lightpen emulation, too.

In the guide for the DK'Tronics Lightpen (http://www.cpcwiki.eu/index.php/Dk%27tronics_Lightpen) is a bug:

bad:

10 out &1C00, 17 : L=inp(&1F00) : out &1C00, 16 : H=inp(&1F00)
20 L=H*256+L-12292 : Y=L/40 : X=L-Y*40


correct:

10 out &1C00, 17 : L=inp(&1F00) : out &1C00, 16 : H=inp(&1F00)
20 L=H*256+L-12292 : Y=INT(L/40) : X=L-Y*40



OMG! Don't use these ports! They collide and just work by accident!

Instead of &1C00 use &BC00 !!!
and...
Instead of &1F00 use &BF00 !!!
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 00:42, 25 January 13
I know :)
Title: Re: GX4000 online-emulation
Post by: TFM on 16:23, 25 January 13
Yes, now ;)
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 17:07, 25 January 13
No. From the wiki page:
Dk'tronics Lightpen - CPCWiki (http://www.cpcwiki.eu/index.php/Dk%27tronics_Lightpen)

Uses I/O ports: #1C00 (http://www.cpcwiki.eu/index.php/I/O_Port_Summary) and #1F00 (http://www.cpcwiki.eu/index.php/I/O_Port_Summary) (as shown in above BASIC example) (and as on page 1-26 and 1-27 of the original manual)
Title: Re: GX4000 online-emulation
Post by: TFM on 20:41, 25 January 13
Well, if you know that you are using wrong and dangerous I/O ports, why did you use it?? They really shall NOT be used!!
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 21:15, 25 January 13
Quote from: TFM/FS on 20:41, 25 January 13
Well, if you know that you are using wrong and dangerous I/O ports, why did you use it?? They really shall NOT be used!!

To test if users like you find this "bug" ;)

Or if they simply ignore that :-D
Title: Re: GX4000 online-emulation
Post by: TFM on 22:10, 25 January 13
Me a user? >:(  Oh MCP help me!!!
Title: Re: GX4000 online-emulation
Post by: Devilmarkus on 23:11, 25 January 13
Hummm so if you aren't a user in this forum, what else then?
A robot? A troll? :D (Only Superman knows)
Title: Re: GX4000 online-emulation
Post by: TFM on 21:53, 26 January 13
Stop trolling Markus, you obviously have too much spare time  ;)

Damn user! :laugh:
Powered by SMFPacks Menu Editor Mod