1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-21 21:29:17 +00:00
8bitworkshop/presets/vcs/skeleton.cc65

69 lines
1.1 KiB
Plaintext
Raw Normal View History

2023-10-15 15:28:48 +00:00
2023-11-06 00:10:35 +00:00
/*
See the "VCSLib Demo" example for more features.
*/
//#resource "vcslib/vcs-ca65.inc"
//#resource "vcslib/kernel.inc"
//#link "vcslib/vcslib.ca65"
//#link "vcslib/frameloop.c"
//#link "vcslib/mapper_3e.ca65"
#include <peekpoke.h>
#include "vcslib/bcd.h"
#include "vcslib/vcslib.h"
#pragma wrapped-call (push, bankselect, bank)
#pragma code-name (push, "ROM0")
void init(void) {
// init code here
}
void my_preframe(void) {
// stuff that happens before the frame is drawn
TIA.colubk = 0x00;
}
void my_kernel(void) {
byte i;
for (i=0; i<190; i++) {
do_wsync();
TIA.colubk = i;
}
}
void my_postframe(void) {
// stuff that happens after the frame is drawn
}
void kernel_loop() {
while (1) {
kernel_1();
my_preframe();
kernel_2();
my_kernel();
kernel_3();
my_postframe();
kernel_4();
}
}
#pragma code-name (pop)
#pragma wrapped-call (pop)
/*
The main() function is called at startup.
It resides in the shared ROM area (PERM).
*/
2023-10-15 15:28:48 +00:00
void main(void) {
2023-11-06 00:10:35 +00:00
// initialization
init();
// main kernel loop
kernel_loop();
2023-10-15 15:28:48 +00:00
}
2023-11-06 00:10:35 +00:00