1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00

Support for the Plus/4 by john "graham" selck.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3930 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-02-11 17:37:18 +00:00
parent feb31603da
commit 5d56159421
2 changed files with 46 additions and 2 deletions

View File

@ -78,8 +78,9 @@ Platforms: All systems that have the Commodore SID (Sound Interface
-----------------------------------------------------------------------------
Name: plasma
Description: A fancy graphics demo written by groepaz/hitmen.
Platforms: The program needs a VIC, so it runs on the following systems:
C64, C128, CBM510
Platforms: The program needs a VIC, or a TED, so it runs on the following
systems:
C64, C128, CBM510, Plus/4
-----------------------------------------------------------------------------
Name: sieve
@ -88,6 +89,7 @@ Description: Implements the "Sieve of Eratosthenes" as a way to find all
a benchmark program.
Platforms: All systems with conio and clock support:
Atari, C16, C64, C128, CBM510, CBM610, PET, Plus/4
-----------------------------------------------------------------------------
Name: tgidemo
Description: Shows some of the graphics capabilities of the "tiny graphics

View File

@ -27,13 +27,25 @@
# define CHARSET 0xE000
# define outb(addr,val) pokebsys ((unsigned)(addr), val)
# define inb(addr) peekbsys ((unsigned)(addr))
#elif defined(__PLUS4__)
# define SCREEN1 0x6400
# define SCREEN2 0x6C00
# define CHARSET 0x7000
# define outb(addr,val) (*(addr)) = (val)
# define inb(addr) (*(addr))
#endif
/* Values for the VIC address register to switch between the two pages */
#if defined(__PLUS4__)
#define PAGE1 ((SCREEN1 >> 8) & 0xF8)
#define PAGE2 ((SCREEN2 >> 8) & 0xF8)
#define CHARADR ((CHARSET >> 8) & 0xFC)
#else
#define PAGE1 ((SCREEN1 >> 6) & 0xF0) | ((CHARSET >> 10) & 0x0E)
#define PAGE2 ((SCREEN2 >> 6) & 0xF0) | ((CHARSET >> 10) & 0x0E)
#endif
@ -170,6 +182,10 @@ int main (void)
unsigned char initflag;
unsigned char graphflag;
#endif
#if defined(__PLUS4__)
unsigned int i;
unsigned char v2;
#endif
clrscr ();
cprintf ("Making charset, mompls");
@ -197,18 +213,39 @@ int main (void)
#endif
/* Remember the VIC address register */
#if defined(__PLUS4__)
v = inb (&TED.char_addr);
v2 = inb (&TED.video_addr);
#else
v = inb (&VIC.addr);
#endif
#if defined(__PLUS4__)
for (i=0;i<1000;i++) {
((unsigned char *) (SCREEN1-0x0400))[i] = 0;
((unsigned char *) (SCREEN2-0x0400))[i] = 0;
}
outb (&TED.char_addr, CHARADR);
#endif
/* Run the demo until a key was hit */
t = clock ();
while (!kbhit()) {
/* Build page 1, then make it visible */
doplasma ((unsigned char*)SCREEN1);
#if defined(__PLUS4__)
outb (&TED.video_addr, PAGE1);
#else
outb (&VIC.addr, PAGE1);
#endif
/* Build page 2, then make it visible */
doplasma ((unsigned char*)SCREEN2);
#if defined(__PLUS4__)
outb (&TED.video_addr, PAGE2);
#else
outb (&VIC.addr, PAGE2);
#endif
/* Count frames */
f += 2;
@ -216,7 +253,12 @@ int main (void)
t = clock() - t;
/* Switch back the VIC screen */
#if defined(__PLUS4__)
outb (&TED.video_addr, v2);
outb (&TED.char_addr, v);
#else
outb (&VIC.addr, v);
#endif
#if defined(__C64__) || defined(__C128__)
/* Move back the VIC 16K block */