2024-05-02 16:52:06 +00:00
|
|
|
#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;
|
2024-05-27 20:50:56 +00:00
|
|
|
screenSetup->currentBuffer = 0;
|
2024-05-02 16:52:06 +00:00
|
|
|
}
|