Question about ZP vars $10...$18

Talk about programming CreatiVision (except games programming). Projects of homebrew hardware are also welcome.
Post Reply
User avatar
sannyx
Posts: 11
Joined: Tue Feb 07, 2017 2:06 pm

Question about ZP vars $10...$18

Post by sannyx » Fri Mar 03, 2017 4:13 pm

Hi,

I think they should reflect joystick movement ($11, $13) and trigger buttons ($16, $17).

They always seem to be zero with my CV.

I'm using this cc65 test program:

Code: Select all

#include <conio.h>
#include <creativision.h>

unsigned char *zpptr = (unsigned char *)0x10;

int main(void)
{
  int i = 0;
  asm ("cli");

  gotoxy(0,0);
  cprintf("10 11 12 13 14 15 16 17 18\r\n");
 endless:
  zpptr = (unsigned char *)0x10;
  gotoxy(0,1);
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  cprintf("%02X ", *zpptr); ++zpptr;
  gotoxy(0,3);
  cprintf("I = %04X\r\n", ++i);
  goto endless;
  return 0; // blah
}

When I run it on an emulator (https://svn.code.sf.net/p/creativisionemulator/code), the values of those ZP variables change when I move the joystick or press a trigger. But they don't change on a real CV.

What is wrong?

I was trying to attach the compiled program, but it doesn't let me ("invalid file externsion", tried *.rom, *.bin, *.bla, and no extension at all).
The file is on ftp://ftp.groessler.org/pub/chris/tmp/zpvars-test.rom.

regards,
chris
User avatar
Mobsie
Posts: 708
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: Question about ZP vars $10...$18

Post by Mobsie » Fri Mar 03, 2017 9:15 pm

Hi, ich teste das am Wochenende. Ich verwende auch in meiner cc65 lib diese addressen und in all meinen asm programmen.

I will test on weekend, i use the same zp stuff in my Cc65 lib and in all my asm stuff.

Regards
Mobsie
User avatar
sannyx
Posts: 11
Joined: Tue Feb 07, 2017 2:06 pm

Re: Question about ZP vars $10...$18

Post by sannyx » Sat Mar 04, 2017 9:11 am

I think I've found the problem.

The cc65 runtime didn't enable vertical blank interrupts. I've changed the display controller configuration there, and now it seems to work.

I tested on MAME. I don't have access to a real CV during this weekend so I'll try on real hardware beginning of next week.

I've put a zpvars-test-new.rom on the ftp server in case you want to try it out.

regards,
chris
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Question about ZP vars $10...$18

Post by Scouter3d » Sat Mar 04, 2017 3:58 pm

Hi,

I just ran your "zpars-test-new.rom" on the CSL and it works fine!!!! ;0)

Greetings, TOM:0)
User avatar
sannyx
Posts: 11
Joined: Tue Feb 07, 2017 2:06 pm

Re: Question about ZP vars $10...$18

Post by sannyx » Sun Mar 05, 2017 12:27 pm

Thanks for the feedback, TOM:0)
Post Reply