34 lines
729 B
C
34 lines
729 B
C
|
#include "screen.h"
|
||
|
#include "types.h"
|
||
|
|
||
|
#include <clib/exec_protos.h>
|
||
|
#include <exec/memory.h>
|
||
|
|
||
|
void allocateScreenMemory(struct ScreenSetup *screenSetup) {
|
||
|
char *memory = (char *)AllocMem(
|
||
|
TOTAL_SCREEN_SETUP_SIZE(screenSetup),
|
||
|
MEMF_CLEAR | MEMF_CHIP
|
||
|
);
|
||
|
|
||
|
screenSetup->memoryStart = memory;
|
||
|
}
|
||
|
|
||
|
void freeScreenMemory(struct ScreenSetup *screenSetup) {
|
||
|
FreeMem(
|
||
|
screenSetup->memoryStart,
|
||
|
TOTAL_SCREEN_SETUP_SIZE(screenSetup)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
void prepareScreen(
|
||
|
struct ScreenSetup *screenSetup,
|
||
|
uint16_t width,
|
||
|
uint16_t height,
|
||
|
uint8_t bitplanes
|
||
|
) {
|
||
|
screenSetup->width = width;
|
||
|
screenSetup->height = height;
|
||
|
screenSetup->bitplanes = bitplanes;
|
||
|
screenSetup->nextBitplaneAdvance = width * height / 8;
|
||
|
}
|