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;
}