1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-25 18:33:11 +00:00
8bitworkshop/presets/c64/common.c

29 lines
447 B
C
Raw Normal View History

2020-02-02 18:17:31 +00:00
#include "common.h"
2022-08-09 14:47:55 +00:00
void raster_wait(byte line) {
2020-02-02 18:17:31 +00:00
while (VIC.rasterline < line) ;
}
void wait_vblank(void) {
raster_wait(255);
}
2022-08-09 14:47:55 +00:00
static byte VIC_BANK_PAGE[4] = {
0xc0, 0x80, 0x40, 0x00
};
2022-08-11 20:27:20 +00:00
char* get_vic_bank_start() {
2022-08-09 14:47:55 +00:00
return (char*)(VIC_BANK_PAGE[CIA2.pra & 3] << 8);
}
2022-08-11 20:27:20 +00:00
char* get_screen_memory() {
return ((VIC.addr & 0xf0) << 6) + get_vic_bank_start();
}
char __fastcall__ poll_keyboard() {
asm("jmp $f142");
return __A__;
}