WIP: Reversi

Talk about programming of homebrew games only.
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: WIP: Reversi

Post by Scouter3d » Thu May 09, 2013 7:42 am

PS: I do remember Kurt telling me about some program of his was running to fast for the real CV or so, so he had to slow it down...
Maybe Kurt could tell you more (i do not remember what was wrong...)
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 11:59 am

I look forward to your results.

To be sure, it should be allowed to write to the VDP while the raster line is on a visible line? I.e. one doesn't have to wait for VBLANK every time in order to touch the VDP? I should double check Kurt's hires demos and perhaps disassemble some game program to be sure.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 12:35 pm

Ok, I made a test image containing the following:

8K Auto Chase x2
16K empty
4K Crazy Chicky x4
16K empty
16K Titanic demo x2 (my mistake)
8K Police Jump x2
16K empty

All three games play alright, no graphic glitches. The demo doesn't start, probably because I'm fooling the Creativision it is a 32K program.

It means I should check the code of those original VTech games to get hints what they do differently from what I (and the rest of you, I suppose) do. Perhaps I should ensure that all memory from $0000 - $03FF is emptied at power on.
User avatar
Mobsie
Posts: 708
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: WIP: Reversi

Post by Mobsie » Thu May 09, 2013 2:08 pm

Hi Carlsson,

most TI99/4a and Memotech programmer i know never touch the VDP in a scan-line.
When is absolute needed then disable before the interrupt and turn on after again.

Some emu`s fix VDP trouble`s like for example the 8-sprite error in Half-Bitmap-Mode, but real hardware not.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 2:22 pm

How did you with the map demo, do you disable interrupt before each time you write to the VDP or wait for VBLANK?

In the mean time, I disassembled Crazy Chicken. It makes quite a bit of BIOS calls, of which one is labeled to clear VDP RAM. However that routine seems to depend on additional parameters and made the case worse when I tried it without extra parameters. Again, in FunnyMu nothing strange happens. Unfortunately my installation of MESS causes my PC to spontaneously reboot, and CvEmu also plays nice.

Maybe you remember that I mentioned that I found the MESS emulation behave strangely with the keys test program, printing text strings on unexpected positions. Now with results on actual hardware, I'm willing to accept that MESS might produce the best emulation, if it can spot mistakes in code that others can't.

Another thing I tried was to skip the Creativision logotype, but it makes no difference. It should be noted though that the logotype (drawn by BIOS) always looks fine, the glitches don't appear until my own code executes.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 2:33 pm

Encasing all VDP calls with SEI/CLI didn't make it better. VBLANK next? Frankly this confuses me greatly, there must be something obvious I have overlooked.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi

Post by MADrigal » Thu May 09, 2013 2:39 pm

Hm.... maybe your routines are "too fast" and the VDP can't stay after them?

I remember Kurt's very first demo had very bad glitches over the screen, and he had to "fix" the source code, by making it "slower".

All demos worked fine on the emulator, but the 2nd one only looked perfect on real hardware.
User avatar
Mobsie
Posts: 708
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: WIP: Reversi

Post by Mobsie » Thu May 09, 2013 2:40 pm

yes, in the map-demo and in the game i write now i access the register or move to VDP memory only in the VBL.

I also use then the VBL for set timing flags for the main loop.
My source code part for the VBL is strange and long because i use unrolled loops etc., but then i enough time to do all the VDP stuff.

Bios calls i don`t use here at the moment because of the JSR/RTS.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 2:56 pm

If it bailed out completely, or displayed the same errors all the time, I wouldn't be as confused. Here are a partial list of errors that occur:

* Reversi logotype garbled
* Characters plotted at odd locations
* Border around the board is plotted with too few characters, but rounding still occurs
* Additional (C) signs (part of my font) drawn at the bottom of screen
* Squares in the board sometimes are black + green instead of light green + green
* Markers sometimes are white + white instead of black + white
* Every blank character (space) on screen has one black pixel in them
* Some characters have missing pixels, or are displayed/defined offset by one line

As you see, there are all kinds of errors and not all of them show up at the same time. I will look at the BIOS routines for writing to the VDP, if those wait for VBL or in another way delay execution.

Of course, I can burn Mobsie's map demo to cartridge as well and see if that one executes like it should! :twisted:
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi

Post by MADrigal » Thu May 09, 2013 3:05 pm

Did you try the "starfield" demos on real hardware? Do they work?
Post Reply