OSDK .tap takes a bit too long to load ..

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

User avatar
ibisum
Wing Commander
Posts: 1758
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

OSDK .tap takes a bit too long to load ..

Post by ibisum »

.. for the code it contains.

As part of a workshop here at the museum, I wanted to show the OSDK and C environment, which works great. The only thing I'm wondering is why this code takes so long to load .. is there a way to make the .TAP file contain *only* the regions necessary, or is the OSDK simply a lot to load?

Code: Select all

//
// This program simply display a picture on the hires 
//  screen and then overwrites it with colourful bytes
//

#include <lib.h>
extern unsigned char LabelPicture[]; // derived from the OSDK picture example

#ifdef TEST_N
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#endif

#define MASK_RANGE(byte, start1, end1, start2, end2) \
    ((byte >= start1 && byte <= end1) || (byte >= start2 && byte <= end2) ? 0 : byte)

#define HIRES_BEGIN (0xA000)
#define HIRES_END (0xBF3F)

int main(int argc, char *argv[]) 
{
	unsigned int a = 0;
	unsigned char v = 0;
    // Seed for random number generation
    srand(rand());
	hires();
	memcpy((unsigned char*)HIRES_BEGIN,LabelPicture,8000);
	for(a=HIRES_BEGIN;a<=HIRES_END;a++) {
	// Mask off the blinky/futzy attributes ..
        v = MASK_RANGE(MASK_RANGE(rand() % 256, 24,27,152,155), 8,15,136,143);;
//		printf("a: %d v: %d ", a, v);
		poke(a,v);
	}

    return 0;
}

User avatar
Chema
Game master
Posts: 3081
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: OSDK .tap takes a bit too long to load ..

Post by Chema »

If I recall correctly it is not related to unused areas, but to the important overhead needed by the C code (managing the stack frame, params, type handling..) plus the size of the libraries that the code uses... although I think a lot of effort was put to reduce them to the minimum.
User avatar
Dbug
Site Admin
Posts: 4742
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: OSDK .tap takes a bit too long to load ..

Post by Dbug »

The easiest way to see where the size goes is to run the osdk_showmap, so you get a detailed list of all the code and data sections.
Post Reply