emufreak / iAmiga

iAmiga sources
45 stars 17 forks source link

-enabled Sprite to Sprite collision detection #19

Closed mithrendal closed 8 years ago

mithrendal commented 8 years ago

-added much newer code from uae4arm project, for Sprite to Playfield detection and enabled it -added much newer code from uae4arm project, for Playfield to Playfield detection but intentional did not invoke it as it is only used by one known game called rotor

games like archon and gravity force which depend on proper collision detection do work now

emufreak commented 8 years ago

Glad you joined our efforts. Welcome to the team :-)

simontoens commented 8 years ago

@mithrendal nice to see your pull request! I will have to try those games.

mithrendal commented 8 years ago

@you both it is a pleasure ! There are more pull requests to come in the next weeks. Next will be the possibility to add an extra vertical stretch by n pixel. As I have seen a lot of games, that leave the space at the bottom of a screen unused (e.g. black). By adding some pixel to the vertical stretch the full display is used. The amount of the stetch has to be configured per game as the unused area in games do vary. I will add a new Tablecell to the display settings and call it "increase vertical stretch by pixel". I will propably do it on weekend. ;-) Next will be the possibility to play multiplayer games. I will at first implement an very simple approach "other ios devices used as a remote joystick" with help of the Multipeer Connectivity Framework. I have done a ProofOf Concept already but it is based on the defender branch. Will port it to the 1.1.0b1 in the next weeks

mithrendal commented 8 years ago

@simontoens

You have to get exactly this file if you like to try out. Because the most archon adfs you will find are only runnable with kickstart1.1-1.2. Archon was programmed in 1985 or so. But it is a great game especially in Multiplayer.

archon & archon 2 (1986)(electronic arts) & one on one (1992)(scorpius)[kick1 3 patched by miami bass]

http://thegamearchives.net/?val=0_2_1_0_0_9_102787_0_0_0_0

simontoens commented 8 years ago

@mithrendal I also thought about being able to use another iOS device as a joystick, that's great you are looking into that. In your proof of concept, how is the latency? Is there a noticeable delay between using the joystick on the iOS device and the emulator reacting?

Thanks for the game info. I have kickstart 1.2 from my old Amiga so maybe it will just work? :)

Another question for you, since you are messing with display stuff. Workbench/AmigaDOS looks horrible, seems like we are running in the wrong resolution. Do you know how/where this needs to be fixed?

mithrendal commented 8 years ago

@simontoens latency is not a problem at all, in fact the connection is super responsive. At least when the devices are close together (some meters). I played for example alien breed, archon and speedball2 with a friend together (2 iphones) and there is not the slightest disadvantage for the one at the remote device. Also it works over WIFI or Bluetooth (of course without a router). You will see it soon...

yes the kickstart from your A1000 will work ;-)

Resolution: Yes I also noticed. The resolution is 320x256 where it should be 640x512 in Workbench/AmigaDos. I already tried to fix it some months ago, I made a copy and changed a lot of settings/lines of code througout the whole project to make it at force to hires ;-). In the end I had the Workbench at HiRes but it was horizontaly clipped at the half. At least that means it is possibly to repair it but it needs further investigation. I think I still have that experimental copy, I will have to look for it.

simontoens commented 8 years ago

No latency - sounds great!

The kickstart is actually from my Amiga 500. :)

Resolution: sounds good. I think when I was googling about the resolution issue I found your post on one of the amiga forums where you described this, but I didn't realize that was you :)

mithrendal commented 8 years ago

@simontoens Multiplayer POC: what I actually did there is. Player-One at joystickport1 plays on an iphone directly while player-Two's iphone is used as joystick only and feeds the results of the joystick movements on his device (which would normaly go into his amiga emulation) that are two unsigned int custom registers over the MultipeerConnectivityframework into the joystickport0 (that is the mouse port) of Player-Ones emulation. So only when the joystick direction or button-press changes it will tranfer only two int-values. With that way it is no wonder that it is that energy friendly and free of any latency. In the next step I want even go further and connect two iphone-remotes (joystick1 and joystick0) to an ipad for example. The JoyPad settings screen would be the right place to configure it, what do you think? The downside of this solution is, that all players look on only one device. But it is nervertheless really fun believe me ;-). If we have all this in emufreaks branch, we can later try to save the game state of the serving ios device and restore ii into the remotes and do there the parallel execution of the game. That way the players can look each onto theri own devices.

Resolution: yes. you probably found my post on the english amiga board. My name there is yesplease. ;-)

mithrendal commented 8 years ago

@simontoens Hi Simon I found something about your resolution question

in drawing.cpp in the method void pfield_init_linetoscr (void)

there is a odd thing. In other uae4all editions it has not the 4 following lines if (res_shift) pfield_do_linetoscr=(line_draw_func )pfiled_do_linetoscr_1; else pfield_do_linetoscr=(line_draw_func )pfiled_do_linetoscr_0;

if you out comment them (e.g. remove them) then hires gets displayed very clear. That is all characters/text on workbench resolution 640x256 is displayed fine and clear.

First part of the problem solved.

BUT you will get only half of the now beautiful workbench screen. It is clipped to the half. The resolution is now high but the mapping from amiga coordinates to Emulationview is still not correct...

I see a lot of hard coded lo_res in the code which may be the second problem.

like here in emulationViewController

define kDisplayWidth 320.0f

define kDisplayHeight 240.0f

define kInputFramePortrait CGRectMake(0, 0, 320.0f * S_PSCALE, 480.0f * S_PSCALE)

// stretched version, specifically cropped for IK+

define kInputFrameLandscape CGRectMake(0, 0, 480.0f * S_LSCALE, 320.0f * S_PSCALE)

S_PSCALE = S_WIDTH / 320.0f;
S_LSCALE = S_HEIGHT / 480.0f;
mithrendal commented 8 years ago

@simontoens updated the last comment

simontoens commented 8 years ago

@mithrendal thanks yes I have also looked around and saw all the hardcoded resolutions. Good find about the code in drawing.cpp! Getting highres to work is pretty high on the priority list for me, although arguably the workbench is of limited use on an iOS device. But it is just so ugly right now...! I am using my limited free time to try to get hd support to work so if you want to try to get highres to work that would be fantastic. Otherwise I will look into it more once I succeed (or fail) to add hd support.

mithrendal commented 8 years ago

@simontoens I would like to look into it. Like you I have only some free limited time. Familiy father ;-) It was also one point on my wishlist (next to multiplayer which is now working fine). I think the hardcoded lores width and height is a tribut to the iphones non-retina-display 480x320 which could not render the amazing highresolution of the amiga ;-) The code base is quite old, retina then was a new thing. An first approach is to find all those hardcodings and analyse them. I will do this.

simontoens commented 8 years ago

Sounds good!

emufreak commented 8 years ago

I plan to release Version 1.1 next week. At the Moment without this pull request. I plan to Iclude it in the next minor release that will be released in April/May. I hope this is fine

mithrendal commented 8 years ago

As you like ;-). Btw when do you plan to merge #25 ? I like to use this airdrop sharing of mrstargazer.

simontoens commented 8 years ago

@emufreak for the release will you replace whatever is in defender now with the current state of 1.1.0b1? How about deleting "defender" and calling the main branch (the non-dev branch) "master" to follow the traditional git model? ps: is the branch called "defender" because some version of this emulator was used to release Defender of the Crown on the app store?

mithrendal commented 8 years ago

Isn't it possible to just delete the defender and rename the 1.1.0b1 to master? Edit: @simontoens oh sorry. I see that this is just what you proposed.

simontoens commented 8 years ago

Yes definitely. In the end I think we want 2 branches (as we have today): one for current development and one that is stable and has the latest release. In our repo we have 1.1.0b1 and defender respectively, I suggest we rename them to something more common like "development" and "master".

On Mar 7, 2016, at 02:11, mithrendal notifications@github.com wrote:

Isn't it possible to just delete the defender and rename the 1.1.0b1 to master?

― Reply to this email directly or view it on GitHub.

emufreak commented 8 years ago

I'll rename the branches. Development and master sounds sensible to me. Below a draft of the release Notes. Did I miss something?

iUAE 1.1.0 Release Note draft

-Support for Multiple Configurations -Completely Redesigned OnScreen Joypad (Supports Up To Four Programmable Buttons now) -Map Amiga Keyboard Buttons to Physical Joypad or Onscreen Joypad -New GUI -Configurable Onscreen Buttons to Map Keyboard Buttons (Thanks SimonToens) -Enabled Sprite To Sprite Collision Detection. Games Like Archon and Gravity Force run now (Thanks Mithendral) -Several New Options for Display Settings

simontoens commented 8 years ago

I think this is the first release of the 1.1.0b1 branch? If so:

Support for df2-df4 Improved state save/restore

On Mar 8, 2016, at 05:51, emufreak notifications@github.com wrote:

I'll rename the branches. Development and master sounds sensible to me. Below a draft of the release Notes. Did I miss something?

iUAE 1.1.0 Release Note draft

-Support for Multiple Configurations -Completely Redesigned OnScreen Joypad (Supports Up To Four Programmable Buttons now) -Map Amiga Keyboard Buttons to Physical Joypad or Onscreen Joypad -New GUI -Configurable Onscreen Buttons to Map Keyboard Buttons (Thanks SimonToens) -Enabled Sprite To Sprite Collision Detection. Games Like Archon and Gravity Force run now (Thanks Mithendral) -Several New Options for Display Settings

― Reply to this email directly or view it on GitHub.

simontoens commented 8 years ago

Also: roms (just like adfs) can be copied using iTunes and will get picked up by the emulator.

emufreak commented 8 years ago

Makes sense. I'll add this. Didn't you fix some disk loading issue also?

emufreak commented 8 years ago

Yes the parent branch was used to release Defender of the Crown in the App Store. I used this branch because it was the most recent. Turned out this code wasn't much use for us though.

simontoens commented 8 years ago

I fixed something related to restoring the disk state when loading a saved emulator state.

On Mar 8, 2016, at 15:41, emufreak notifications@github.com wrote:

Makes sense. I'll add this. Didn't you fix some disk loading issue also?

― Reply to this email directly or view it on GitHub.

MrStargazer commented 8 years ago

@emufreak why not merging the two open pull request into 1.1.0b before turning it into the new master? So we get a clean base for the new master.

emufreak commented 8 years ago

I planed the following steps

I merged all Changes up to now except the two open Pull Requests to defender. Next step is to rename defender to master and 1.1.0b to dev. After this I'll test the two open Pull Requests / Pull them to dev and merge them to Master for Version 1.1.1, which will be released April/May

emufreak commented 8 years ago

@simontoens

OK this is part of the Improvements of the Savestates then

mithrendal commented 8 years ago

@emufreak Could you please enable the github issues feature? It will allow us to better organise ourselfs. Thank you.

emufreak commented 8 years ago

@simontoens Wasn't there a fix you implemented to make The Chaos Engine playable?

emufreak commented 8 years ago

@mithendral Yes good Idea. Wanted to do that for some time now. I'll have a look into it

mithrendal commented 8 years ago

@emufreak yes chaos engine works now. It did not before. I even played it in multiplayer ;-) on this newer version.

mithrendal commented 8 years ago

@emufreak it is very easy. Just go to the settings page on the github website of your account and check the checkbox for issues. 3 seconds. ;-)

simontoens commented 8 years ago

Ah yes, I got that to work by setting this macro: SAFE_MEMORY_ACCESS. Always better to be safe when accessing memory.