Check-in [7268763706]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In sjme_vmmresolve allow Virtual Memory to be banked.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7268763706a0801a6396ffaccf41619802ac4e79
User & Date: stephanie.gawroriski 2019-07-13 12:56:35
Context
2019-07-13
13:25
Adjust SummerCoatROM builder to allow potential fork offs. check-in: abbc2b7c1f user: stephanie.gawroriski tags: trunk
12:56
In sjme_vmmresolve allow Virtual Memory to be banked. check-in: 7268763706 user: stephanie.gawroriski tags: trunk
01:38
Actually link in all the DOS files. check-in: 8e18d64220 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ratufacoat/sjmerc.h.

359
360
361
362
363
364
365



366
367
368
369
370
371
372
	uintptr_t realptr;
	
	/** The fake memory pointer. */
	sjme_jint fakeptr;
	
	/** The memory region size. */
	sjme_jint size;



} sjme_vmemmap;

/**
 * Java virtual machine arguments.
 *
 * @since 2019/06/03
 */







>
>
>







359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
	uintptr_t realptr;
	
	/** The fake memory pointer. */
	sjme_jint fakeptr;
	
	/** The memory region size. */
	sjme_jint size;
	
	/** Banked access function. */
	uintptr_t (*bank)(sjme_jint* offset);
} sjme_vmemmap;

/**
 * Java virtual machine arguments.
 *
 * @since 2019/06/03
 */

Changes to ratufacoat/sjmercvm.c.

104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
...
125
126
127
128
129
130
131



132
133













134

135
136
137
138
139
140
141
	return rv;
}

/** Resolves the given true memory address. */
void* sjme_vmmresolve(sjme_vmem* vmem, sjme_vmemptr ptr, sjme_jint off,
	sjme_error* error)
{
	sjme_jint i, n;
	sjme_vmemmap* map;
	sjme_vmemptr optr;

	
	/* Invalid argument. */
	if (vmem == NULL)
	{
		sjme_seterror(error, SJME_ERROR_INVALIDARG, 0);
		
		return NULL;
................................................................................
	
	/* Search for the mapping. */
	for (i = 0, n = vmem->count; i < n; i++)
	{
		/* Get mapping. */
		map = vmem->maps[i];
		



		/* Is in range? */
		if (optr >= map->fakeptr && optr < map->fakeptr + map->size)













			return (void*)(map->realptr + (optr - map->fakeptr));

	}
	
	/* Address is not valid. */
	sjme_seterror(error, SJME_ERROR_BADADDRESS, optr);
	return NULL;
}








|


>







 







>
>
>

<
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
126
127
128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
	return rv;
}

/** Resolves the given true memory address. */
void* sjme_vmmresolve(sjme_vmem* vmem, sjme_vmemptr ptr, sjme_jint off,
	sjme_error* error)
{
	sjme_jint i, n, moff;
	sjme_vmemmap* map;
	sjme_vmemptr optr;
	uintptr_t mp;
	
	/* Invalid argument. */
	if (vmem == NULL)
	{
		sjme_seterror(error, SJME_ERROR_INVALIDARG, 0);
		
		return NULL;
................................................................................
	
	/* Search for the mapping. */
	for (i = 0, n = vmem->count; i < n; i++)
	{
		/* Get mapping. */
		map = vmem->maps[i];
		
		/* Calculate the mapping offset. */
		moff = optr - map->fakeptr;
		
		/* Is in range? */

		if (moff >= 0 && moff < map->size)
		{
			/* If this mapping is banked, make sure it is mapped. */
			if (map->bank != NULL)
			{
				/* Load the bank into memory. */
				mp = map->bank(&moff);
				
				/* Return from the base mapping using the returned offset. */
				return (void*)(mp + moff);
			}
			
			/* Otherwise, use direct memory access. */
			return (void*)(map->realptr + moff);
		}
	}
	
	/* Address is not valid. */
	sjme_seterror(error, SJME_ERROR_BADADDRESS, optr);
	return NULL;
}

Changes to ratufacoat/sys_palm.c.

22
23
24
25
26
27
28












29
30
 * @param cmd Command used.
 * @param cmdpbp Command parameter block.
 * @param launchflags Flags used to launch the application.
 * @since 2019/07/12
 */
UInt32 PilotMain(UInt16 cmd, void* cmdpbp, UInt16 launchflags)
{












	return 0;
}







>
>
>
>
>
>
>
>
>
>
>
>


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 * @param cmd Command used.
 * @param cmdpbp Command parameter block.
 * @param launchflags Flags used to launch the application.
 * @since 2019/07/12
 */
UInt32 PilotMain(UInt16 cmd, void* cmdpbp, UInt16 launchflags)
{
	/* Which Launch Code? */
	switch (cmd)
	{
			/* Normal application launch. */
		case sysAppLaunchCmdNormalLaunch:
			break;
			
			/* Unknown */
		default:
			break;
	}
	
	return 0;
}