Hey Guyz, I have another problem for which I need a bit of advice:
(1) I compiled with MADS a routine to display interlaced graphics for ATARI (multiplegraphicsmode).
(2) I then merged the MADS binaries with my main CC65 compiled program (using merge-xex.exe).
(3) The CC65 program autoruns, loads the image in memory, and then calls the MADS routine with __asm__("jsr $8000");
(4) The image gets displayed, BUT in the process the CC65 interrupts are killed (keyboard, timers...).
Could someone kindly advise me on how I can setup the interlace interrupt without killing the CC65 interrupts?
(see attached code and ATR file demo)
In the following code, the second cgetc() is never executed.
If I remove that line, I can see the program progress to the next line and black out the screen.
Code:
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <conio.h>
#include <unistd.h>
void LoadBitmap(char *filename)
{
FILE* fp;
// Open Map File
fp = fopen(filename, "rb");
if (fp != 0) {
printf("Loading...\n");
fread((char*)(0x4100), 1, 0x1E00, fp);
fclose(fp);
} else {
printf("File not found...\n");
}
}
/*****************************************************************************/
int main (void)
{
LoadBitmap("image.dat");
printf("Ready to start MGM\n");
cgetc ();
// Start MGM
__asm__("jsr $8000");
cgetc ();
// Black out the screen
memset((char*)0x4100, 0, 0x1E00);
cgetc ();
// Done
return EXIT_SUCCESS;
}