Re: Asteroids Deluxe in an FPGA

From: Graham Toal <gtoal_at_gtoal.com>
Date: Fri Jun 25 2004 - 23:10:53 EDT

> Tell me what you need, I'll write it. I've also been interested in preserving
> the CCPU games, though from the somewhat heretical (from this group's point
> of view) aspect of generating C source code from the roms (which should

Oh - I almost forgot - tying this back into the thread subject... I've
written most of a translator for Asteroids and Asteroids Deluxe.

This was a cooperative project with David Welch, and by coincidence
I was talking to him again last week and we are resurrecting this
project from a bit of a hiatus it had fallen into.

To some extent emulating vector games is a little closer to actually
running the hardware because you can run the emulation on a real
vector display if you have a ZVG.

A snapshot of the 'work in progress' can be seen here:

http://www.gtoal.com/sbt/6502/dwelch-modified/droids/game.c

I don't know how much you guys are interested in emulation, but if
you've ever worked on emulators you might appreciate how little emulator
overhead this conversion has. I went to some effort to automatically
remove redundant flag calculations. Use a good compiler and slave
the 6502 registers into real registers and you should average 2 to 3
target machine instructions per 6502 instructions. Much better than
regular emulation, by a factor of 10.

    case 0x4800:
        A = ram[0x0200 + Y];
    case 0x4803:
        A &= 0x3C;
    case 0x4805:
        A = A >> 1;
    case 0x4806:
        C = A & 0x01;
        A = A >> 1;
    case 0x4807:
        X = A;
    case 0x4808:
        ZN = A = ram[0x02F8 + X];
    case 0x480B:
        if (ZN < 0) { PC = 0x483e; clockticks += 20; return; }
    case 0x480D:
        ram[0x001A] = X;
    case 0x480F:
        ZN = A = 0x05;
    case 0x4811:
        stack[S--] = 0x48; stack[S--] = 0x13;
        PC = 0x48b2; clockticks += 30; return;

    case 0x4814:
        stack[S--] = 0x48; stack[S--] = 0x16;
        PC = 0x6d50; clockticks += 6; return;

    case 0x4817:
        ZN = ++ram[0x02E7];
    case 0x481A:
        ZN = A = ram[0x0200 + Y];
    case 0x481D:
        stack[S--] = A;
    case 0x481E:
        stack[S--] = 0x48; stack[S--] = 0x20;
        PC = 0x61eb; clockticks += 19; return;
---------------------------------------------------------------------------
** Unsubscribe, subscribe, or view the archives at http://www.vectorlist.org
** Please direct other questions, comments, or problems to chris@westnet.com
Received on Fri Jun 25 22:26:31 2004

This archive was generated by hypermail 2.1.8 : Fri Jun 25 2004 - 23:50:01 EDT