Jump to content
IGNORED

TANK MISSION for Colecovision & ADAM


digress

Recommended Posts

If the demos are any example then it looks like the tiles could use cm1 or cm2 or something with more colours ?

The F18A has a lot of enhancements including what I call "enhanced color mode", or ECM. The F18A can support two and three bits per pixel (ECM2 and ECM3), which gives you 4-color or 8-color tiles. The colors on the F18A come from a programmable 64-entry palette which uses 12-bits per color. Of course ECM2 uses twice as many pattern bytes per tile, and ECM3 uses three times as many bytes. Tiles also support a transparent color, which means 3 colors or 7 colors per tile if transparency is enabled.

 

Tiles can also have priority over sprites, be flipped horizontally or vertically, have their own color information per tile (instead of groups of eight), and more. There is also support for a second tile layer (TL2) that is completely independent of the first tile layer (TL1). TL2 can be above or below TL1, can have transparency colors, be scrolled independently of TL1, etc.

 

Sprites also support ECM2 and ECM3 independently of the ECM setting for TL1 or TL2. Sprites can also have their own size, i.e. 8x8 or 16x16 defined independently instead of globally. Sprites can be automatically "linked", so moving one sprite automatically moves the others. Sprites can also be flipped horizontally and vertically like tiles.

 

There are a lot more features too, here is a post I made describing many of them: http://codehackcreate.com/archives/335

 

The main thing I need now is how to impletment the offset in c-language for colecovision.

To unlock the F18A you will probably need to use some in-line assembly to ensure uninterrupted access to the VDP. I'll see if I can come up with an example. As for scrolling, it is just writing to a single VDP Register (VR) with a number between 0 and 255. There is also a little setup of the scroll registers to specify the page table layer, etc. but that's pretty much it. I don't have any way to code for the CV right now, but I'll try to come up with additional examples.

 

 

  • Like 1
Link to comment
Share on other sites

Something like this should work... I haven't tested it as we don't use the same libs and I didn't fire up the Coleco, but it's an adaptation of my TI unlock code. (Which, admittedly, takes some shortcuts. Matt may have some recommendations.) I stepped through the library and it looks like it won't have any issue with the extended registers.

 

I was not 100% sure how the library writes blocks to VRAM, so I just used put_vram_pattern. So if it looks weird, that's why. I'd normally do my own VDP access. ;)

 

Also... I couldn't find the function to /read/ a byte of VDP... just 'get_vdp' which claims to need 256 byte blocks...?? Anyway, that's why I threw in the one odd looking function. Feel free to replace it if there is something already.

 

 

 

char F18APresent=0;        // 0 for no, 1 for yes. Call 'testF18A()' once early on to set it
#define VDPRAM_TEST_ADR 0x1c00  // if you change this, also change the test address in the GPU code (0x1c10)

const unsigned char GPUTEST[] = {
 0x02, 0x00, 0x12, 0x34,     //  LI R0,>1234    get the test value into register 0
 0xC8, 0x00, 0x1C, 0x10,     //  MOV R0,@>1C10 <-- this is the target test adr in VDP RAM
 0x03, 0x40           //  IDLE       This puts the GPU back to sleep
}; 

// safe delay between VDP operations
inline void VDP_SAFE_DELAY() { 
__asm
 nop
 nop
 nop
 nop
 nop
__endasm;
}

// could not find a function in the lib to read a VDP byte? This function reads
// two bytes and returns it as an int. 
// This function MUST NOT be interrupted by status reads.
unsigned int vdp_read2(unsigned int adr) {
 unsigned int ret;

 volatile __sfr __at 0xbf VDPWA;  // VDP write address port
 volatile __sfr __at 0xbe VDPRD;  // VDP read data port

 VDPWA = (adr&0xff);   // send LSB of address (no delay needed)
 VDPWA = (adr >> ;   // send MSB of address (delay needed before read)
 VDP_SAFE_DELAY();

 ret = VDPRD;      // get the MSB (delay needed before next read)
 ret <<= 8;       // shift up to MSB (could be optimized to a move, 1uS)

 VDP_SAFE_DELAY();    // (maybe overkill here, but this function doesn't need to be fast)
 ret |= VDPRD;      // get the LSB

 return ret;
}

// note: whatever function you use, the following sequence MUST NOT be interrupted by VDP status reads...
// make sure your NMI behaves itself. If it is interrupted, detection will fail.
// (I assume) Tank Mission is running my remade nmi which guarantees this. You could also do it in the NMI
// or immediately after it. Call this BEFORE setting your VDP registers as it will corrupt them
// if it is a TMS9928A. Afterwards you can just test F18APresent.
void testF18A() {
 unsigned char idx;

 disable_nmi(); // no interruptions

 // this just tests for presence by running a short GPU program.
 // it does not check for firmware version, which may matter to some
 // programs. That would be a good thing to store in F18Present. 
 // Intended as a starting point, not the final!

 vdp_out(50, 0x80);   // reset and lock F18A (or corrupt VDPR2 if 9928A)

 vdp_out(57, 0x1c);   // write unlock value to register 57 (or corrupt VDPR1)
 vdp_out(57, 0x1c);   // repeat to unlock. This is the sequence that mustn't be interrupted

 // now we copy a little GPU program (9900 Asm) to the VDP and try to execute it.
 // if it's a TMS9928A, nothing will happen. Otherwise it will change a byte of
 // VDP RAM for us.

 put_vram_pattern(VDPRAM_TEST_ADR, GPUTEST, 10, 1);

 // make sure the test address (0x1c10) is zeroed
 idx = 0;        // convenient bit of memory to read zeros from
 put_vram_pattern(0x1c10, &idx, 2, 1);

 // start the GPU program
 vdp_out(54, VDPRAM_TEST_ADR>>;  // MSB in register 54
 vdp_out(55, VDPRAM_TEST_ADR&0xff); // LSB in register 55 - GPU starts!

 // the GPU runs at 100MHz, and will be finished executing long before we can get
 // back into VDP RAM to check the result.

 // read the test word at >1C10 back, the GPU should have set it to >1234
 idx = vdp_read2(0x1c10);
 if (idx == 0x1234) {
  F18APresent = 1;
 } else {
   F18APresent = 0;
 }
}

 

 

To set the scroll register, you should be able to just use vdp_out() to update it, like any other register. :)

Edited by Tursi
  • Like 2
Link to comment
Share on other sites

This is very understandable. If the GPU can execute the program the f18a is present but the original 9928A cannot.

 

Then set a screen mode. Adjust the scroll registers as matthew said. See if I can make it work. I'll have to get my f18a installed first then I'll start making some tests.

 

There is some good info here that would be useful to others . You should also post it in a new thread in the cv programming subforum so it doesn't get lost . Maybe an f18a sticky topic.

Link to comment
Share on other sites

Yeah, as far as I know only JS99er (TI-99/4A web-based emulator) fully supports the F18A. (http://js99er.net/). I have GPU support in Classic99 (also TI) but I need time to do a rewrite of the VDP system to do the rest. But the author of JS99er is here on AtariAge may be willing to share his VDP code, if that helps. ;) His emulator thread is here: http://atariage.com/forums/topic/224744-js99er/page-1?hl=+js99er

Link to comment
Share on other sites

This is very understandable. If the GPU can execute the program the f18a is present but the original 9928A cannot.

That is correct. I did add support for detecting the F18A, but it takes a lot more code. Tursi came up with this method which is much more compact, faster, easier, and the method I would recommend.

 

Then set a screen mode. Adjust the scroll registers as matthew said. See if I can make it work. I'll have to get my f18a installed first then I'll start making some tests.

Yes. Just make sure you do the F18A unlock and detection code first, then set VR0..7, then if the F18A was detected set up and/or use any additional VR8..63 as needed.

Link to comment
Share on other sites

  • 3 weeks later...

F18A Test scrolling on a colecovision

 

I have played with the 2 page setup today with smooth scrolling. It's (The 8 pixel chunky scroll modified with vr27 offsetting) is working reasonably well but glitchy.

 

The 2 page scroll looks great but then all my tile collisions are messed up. The collisions are happening right where they used to be on the screen but are displayed else where such as a rock or bridge or something I bang into.

 

I don't think i'm going to use this on this project but will use it in a future project where I can better plan out how to incorporate the f18a scrolling features and others abilities from scratch.

 

I've uploaded a sample to youtube if you want to check it out.

 

0:00-1:00 just 2 page scrolling

1:00-1:22 a weird screwup that happens after awhile.

1:22-2:00 the planes with the combined character shifting scroll and vr27 offset 0-7 scroll.

 

  • Like 5
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Pretty much final run throught intermediate level. noticed a couple of minor things that need correcting. I'm going to have it published soon as everything else is done.

 

 

https://www.youtube.com/watch?v=KRKa0WyCn_M&t=610s

Looks fantastic. Between this and opcode's f18 support it looks like it is time to mod my system.

 

One small critique tho, I find the dialog boxes like the INFO one at 0:20 very hard to read. First, because the background shows through where there are spaces and second because there is no space between the border and any characters.

 

Right now you have a 12x7 border box, what would look better is a 14x9 box border, then a 12x7 black box inside, then the text inside a 10x5 grid, that would make it much more readable

  • Like 1
Link to comment
Share on other sites

I'm going to have someone else do the publishing this time otherwise I'll never be able to release it.

 

Havn't been able to look at the mr_turtle since the video a couple of months ago. Won't available at the same time. I would want to update a lot more on that yet and it'll probably be rom only on squibly as most people who would be intersted already have a box version so shipping won't be a concern. I probably will make up a few CIB but not very many as there wouldn't be a lot of newcomers for that title as it's more of an upgrade to f18a rather than a new game.

 

Looks great. I'm very excited to play. Are you going to publish F18a Mr. Turtle at the same time? Put me down for both!

 

I shall look into this. I honestly didn't even notice as I've looked at the screens so many times that I don't even see it anymore. The regular coleco version is on a black bg is why i never noticed. Correcting it now. There is also a problem with sprites being on top from time to time.

 

here is the update to the menu as suggested:

https://www.youtube.com/watch?v=iv9R5Z4hbDU&feature=youtu.be

 

Looks fantastic. Between this and opcode's f18 support it looks like it is time to mod my system.

One small critique tho, I find the dialog boxes like the INFO one at 0:20 very hard to read. First, because the background shows through where there are spaces and second because there is no space between the border and any characters.

Right now you have a 12x7 border box, what would look better is a 14x9 box border, then a 12x7 black box inside, then the text inside a 10x5 grid, that would make it much more readable

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...