WIP: Reversi

Talk about programming of homebrew games only.
User avatar
TBCTBC
Posts: 64
Joined: Wed Mar 13, 2013 1:27 pm
Location: Solna, Sweden
Contact:

Re: WIP: Reversi

Post by TBCTBC » Thu May 09, 2013 7:33 pm

Well, at 2 Mhz and a NOP is 2 clock cycles, that's exactly one microsecond then right? So, since the worst case (graphics mode I or II with all sprites enabled) is 8 microsecond for the VDP, 8 NOPs should be exactly right. Though maybe you should calculated the time for the sta too?
User avatar
carlsson
Posts: 514
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 7:43 pm

I added some sanety checks on the plotting, but they don't make any difference. Actually sometimes while playing sound effects, it freezes on top of everything. I believe my Creativision jedi powers still are fairly weak, and I need to seek Yoda to teach me.
User avatar
Mobsie
Posts: 717
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: WIP: Reversi

Post by Mobsie » Thu May 09, 2013 7:45 pm

Yes right, but this all only if you want access to the VDP outside the VBI.

When the VBI start the VDP give you 4300 microsecond for access at full speed.
User avatar
carlsson
Posts: 514
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 8:21 pm

I increased to 16 NOP but no difference. I'd like to wait for VBL but somehow it seems to lock up emulation the way I do it (too often?).

This is the current version. Not entirely perfect, but more reliable than before.
http://youtu.be/rYGpq5Th_pw
User avatar
Mobsie
Posts: 717
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: WIP: Reversi

Post by Mobsie » Thu May 09, 2013 8:26 pm

much better!
User avatar
MADrigal
Site Admin
Posts: 1267
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi

Post by MADrigal » Thu May 09, 2013 9:56 pm

I'm impressed at seeing so many progresses in just a bunch of hours! :)

But is it really possible that the CV is such "hard to programme", that you need to calculate the exact number of cpu cycles inbetween every SEI/CLI cycle, in order to prevent graphics glitches?

On a side note, I finally see the "border" colour... hey it's light cyan... the whole game looks like a C64 game! :-D

Is this the way Carlsson wanted it? Or is it just a "side effect" ?
User avatar
carlsson
Posts: 514
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Thu May 09, 2013 10:23 pm

Yes, it is the intended colour scheme. It could be a VTech Laser 500 game as well, same colour scheme.

I have searched the Internet for general VDP hints, but those I found didn't really apply to my problems.
User avatar
TBCTBC
Posts: 64
Joined: Wed Mar 13, 2013 1:27 pm
Location: Solna, Sweden
Contact:

Re: WIP: Reversi

Post by TBCTBC » Thu May 09, 2013 11:44 pm

I have programmed games for MSX and never had these kind of problems, even on real hardware. Will try to port the gyruss stars and see what happens. Going to Gothenburg tomorrow though, for a retro gaming weekend. See you there, Carlsson!
User avatar
Mobsie
Posts: 717
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: WIP: Reversi

Post by Mobsie » Fri May 10, 2013 1:14 am

Yes, msx is much slower in fact of Bus Access.
Carlsen: to Check the #%10000000 in the Main Programm can be difficult
because when Set you are in the vbi and your Main Programm stop.
User avatar
carlsson
Posts: 514
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Fri May 10, 2013 7:12 am

As I have the routine for interrupt handler, is it so that the interrupt actually is generated at VBL? Perhaps code like this would work?

Code: Select all

VSW: ; VDP_Status_Write, assume address in A/Y
    pha
wait$:
    lda flag
    bne wait$
    lda #128
    sta flag
    pla
    sta SR0 ; CPU bytes somewhere in the $0300 region
    sty SR1
    rts

VDW: ; VDP_Data_Write, assume data in A
    pha
wait$:
    lda flag
    bne wait$
    lda #129
    sta flag
    pla
    sta DR ; SR0 could also be reused as data byte
    rts

Interrupt:
   lda flag
   beq goon2$
   cmp #129
   beq wd$
   lda SR0
   sta VDP_Status_Write
   lda SR1
   sta VDP_Status_Write
   jmp goon$
wd$:
   lda DR
   sta VDP_Data_Write
goon$:
   lda #0
   sta flag
goon2$:
   ... code follows ...
It would "queue" the writes one at a time, and it being executed at the start of the next interrupt. If that wouldn't solve it, I'm out of clues.
Post Reply