Update from Emu42 and Emu71

This commit is contained in:
dgis 2019-10-22 23:39:01 +02:00
parent f9199a03ed
commit e64a354693
9 changed files with 95 additions and 24 deletions

View file

@ -165,6 +165,7 @@ The Eric's Real scripts ("real*.kml" and "real*.bmp/png") are embedded in this a
TODO
- Autosave only works once a manual save has been done (William Hostman from comment).
- Add the name of the file in the toast "State saved".
- The clock seems unsynchronized sometimes.
- Retain a key by right clicking if it is from a mouse.

View file

@ -33,8 +33,8 @@ android {
applicationId "org.emulator.forty.eight"
minSdkVersion 19
targetSdkVersion 28
versionCode 8
versionName "1.6"
versionCode 9
versionName "1.7"
setProperty("archivesBaseName", "Emu48-v$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {

View file

@ -2166,6 +2166,9 @@ void StretchBltInternal(int xDest, int yDest, int wDest, int hDest,
} else if (rop == ROP_PSDPxax) { // P ^ (S & (D ^ P))
UINT destination = *((UINT *) destinationPixel);
*((UINT *)destinationPixel) = (brushColor ^ (sourceColor & (destination ^ brushColor))) | 0xFF000000;
} else if (rop == SRCAND) { // dest = source AND dest
UINT destination = *((UINT *) destinationPixel);
*((UINT *)destinationPixel) = (sourceColor & destination) | 0xFF000000;
} else
*((UINT *)destinationPixel) = sourceColor;
break;
@ -3020,3 +3023,19 @@ BOOL ClearCommBreak(HANDLE hFile) {
//TODO
return FALSE;
}
int WSAGetLastError() {
//TODO
// Win9x break with WSAEINTR (a blocking socket call was canceled)
// if(errno == ECANCELED)
// return WSAEINTR;
return 0;
}
int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData) {
return 0;
}
int WSACleanup() {
return 0;
}

View file

@ -82,6 +82,7 @@ typedef int BOOL;
typedef unsigned long ULONG;
typedef short SHORT;
typedef unsigned short USHORT;
typedef unsigned char UCHAR;
typedef uint64_t ULONGLONG;
typedef int64_t LONGLONG;
typedef int64_t __int64;
@ -334,6 +335,7 @@ enum {
#define TEXT(x) @x
#define LOWORD(x) x
#define MAKEWORD(a, b) ((WORD)(((BYTE)(((DWORD_PTR)(a)) & 0xff)) | ((WORD)((BYTE)(((DWORD_PTR)(b)) & 0xff))) << 8))
#define MAKELONG(a, b) ((LONG)(((WORD)(((DWORD_PTR)(a)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(b)) & 0xffff))) << 16))
#define HIBYTE(i) ((i)>>8)
@ -343,6 +345,7 @@ enum {
#define lstrcpy(d,s) strcpy(d,s)
#define _tcsspn(s,k) strspn(s,k)
#define wsprintf(s,f,...) sprintf(s,f, ## __VA_ARGS__)
#define sprintf_s(s,l,f,...) sprintf((const char *)s,f, ## __VA_ARGS__)
#define HeapAlloc(h,v,s) malloc(s)
#define HeapFree(h,v,p) do{free(p);(p)=v;}while(0)
#define ZeroMemory(p,s) memset(p,0,s)
@ -711,6 +714,7 @@ HBRUSH CreateSolidBrush(COLORREF color);
extern BOOL MoveToEx(HDC hdc, int x, int y, LPPOINT lppt);
extern BOOL LineTo(HDC hdc, int x, int y);
#define SRCCOPY (DWORD)0x00CC0020 /* dest = source */
#define SRCAND (DWORD)0x008800C6 /* dest = source AND dest */
#define PATCOPY (DWORD)0x00F00021 /* dest = pattern */
#define DSTINVERT (DWORD)0x00550009 /* dest = (NOT dest) */
#define BLACKNESS (DWORD)0x00000042 /* dest = BLACK */
@ -1245,8 +1249,6 @@ void performHapticFeedback();
void sendByteUdp(unsigned char byteSent);
void setKMLIcon(int imageWidth, int imageHeight, LPBYTE buffer, int bufferSize);
typedef int SOCKET;
// IO
#define EV_RXCHAR 0x0001
@ -1327,3 +1329,24 @@ extern BOOL SetCommState(HANDLE hFile, LPDCB lpDCB);
extern BOOL PurgeComm(HANDLE hFile, DWORD dwFlags);
extern BOOL SetCommBreak(HANDLE hFile);
extern BOOL ClearCommBreak(HANDLE hFile);
// TCP
typedef int SOCKET;
#define INVALID_SOCKET (SOCKET)(~0)
#define SOCKET_ERROR (-1)
#define WSAEINTR 10004L
extern int WSAGetLastError();
typedef struct WSAData {
WORD wVersion;
WORD wHighVersion;
//...
} WSADATA, * LPWSADATA;
extern int WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData);
extern int WSACleanup();
typedef struct addrinfo ADDRINFO;

View file

@ -0,0 +1,20 @@
#ifndef TRUNK_WS2TCPIP_H
#define TRUNK_WS2TCPIP_H
#include <sys/endian.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/tcp.h>
#include <netinet/in6.h>
typedef struct sockaddr_in6 SOCKADDR_IN6_LH;
typedef SOCKADDR_IN6_LH *PSOCKADDR_IN6;
typedef struct in6_addr *PIN6_ADDR;
#define closesocket close
#endif //TRUNK_WS2TCPIP_H

View file

@ -63,25 +63,9 @@ public class PrinterSimulatorFragment extends AppCompatDialogFragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(AppCompatDialogFragment.STYLE_NO_FRAME, android.R.style.Theme_Holo_Light);
//setStyle(STYLE_NO_FRAME, android.R.style.Theme_Holo_Light);
//setStyle(STYLE_NO_TITLE, android.R.style.Theme_Holo_Light);
//setStyle(STYLE_NO_TITLE, android.R.style.Theme_Material_Light_Dialog_Alert);
//setStyle(STYLE_NO_FRAME, 0);
//setStyle(STYLE_NO_TITLE, 0);
setStyle(AppCompatDialogFragment.STYLE_NO_FRAME, android.R.style.Theme_Material);
}
// @Override
// public void onResume() {
// super.onResume();
// ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
// params.width = ViewGroup.LayoutParams.MATCH_PARENT;
// params.height = ViewGroup.LayoutParams.MATCH_PARENT;
// getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
// }
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

View file

@ -19,6 +19,10 @@ import android.database.Cursor;
import android.net.Uri;
import android.provider.OpenableColumns;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
@ -134,4 +138,24 @@ public class Utils {
return maximumTextureSize;
}
public static void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
// pre-condition
return;
}
int totalHeight = 0;
for (int i = 0; i < listAdapter.getCount(); i++) {
View listItem = listAdapter.getView(i, null, listView);
listItem.measure(0, 0);
totalHeight += listItem.getMeasuredHeight();
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
listView.setLayoutParams(params);
listView.requestLayout();
}
}

View file

@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:3.5.1'
// NOTE: Do not place your application dependencies here; they belong

View file

@ -1,6 +1,6 @@
#Fri Apr 19 10:09:27 CEST 2019
#Tue Oct 22 17:19:08 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip