home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
215.lha
/
AmyLoad
/
newloadrecord.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-02-14
|
2KB
|
66 lines
#include <exec/types.h>
#include <devices/load.h>
#include "execdef.h"
#include "windowinfo.h"
#include "loadrecord.h"
#include "NewLoadRecord.proto"
#include <exec/proto.h>
extern loadrequest *loadRequest;
extern long maxTicks;
extern long maxChip;
extern long maxFast;
extern long maxMem;
LoadRecord *
NewLoadRecord(window_info, type, data_pen_num, ref_pen_num)
register WindowInfo *window_info;
unsigned char type;
unsigned char data_pen_num, ref_pen_num;
{
LoadRecord *record;
if (!(record = (LoadRecord *)AllocMem(sizeof(LoadRecord), 0)))
return NULL;
if (!(record->start_data = (LoadDataValue *)AllocMem(window_info->width * sizeof(LoadDataValue), 0)))
{
FreeMem((char *)record, sizeof(LoadRecord));
return NULL;
}
record->end_data = record->start_data + window_info->width;
record->next_data = record->start_data;
record->max_data = record->start_data;
switch(type)
{
case CPU:
record->scale = 1;
record->scaled_ticks = maxTicks;
break;
case BLITTER:
record->scale = 0;
record->scaled_ticks = maxTicks;
break;
case CHIPMEM:
record->scale = 0;
record->scaled_ticks = maxChip;
break;
case FASTMEM:
record->scale = 0;
record->scaled_ticks = maxFast;
break;
case ALLMEM:
record->scale = 0;
record->scaled_ticks = maxMem;
break;
}
record->deltay = window_info->height;
record->moduloy = 0;
record->type = type;
record->data_pen_num = data_pen_num;
record->ref_pen_num = ref_pen_num;
AddHead(&window_info->loadrecords, &record->node);
return record;
}