WIP: Reversi

Talk about programming of homebrew games only.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi

Post by MADrigal » Fri Jun 28, 2013 11:07 am

No news on the Reversi development side?
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Sun Jun 30, 2013 8:05 pm

I've been too busy with other matters to think about Creativision programming/debugging. With a bit of luck, I might investigate this sometime in the summer, but I'd rather start with a smaller project from scratch to figure out the way to do VDP updates before implementing into the full game.
User avatar
Mobsie
Posts: 708
Joined: Fri Jun 13, 2008 10:38 am
Location: Weinheim, Germany

Re: WIP: Reversi

Post by Mobsie » Mon Jul 01, 2013 7:00 pm

thank you for the update. We all love your game.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Sat Aug 02, 2014 4:46 pm

Small update in that I believe I may have solved my VDP issues. Now to improve some algorithms so the graphics run smoothly and some other twiddling, and soon this one might be finished.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi

Post by MADrigal » Sun Aug 03, 2014 6:49 pm

Woho, that's great news, Anders! I cant wait to play the final version. I'm available for a last-minute beta-test if you need any.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Sun Aug 03, 2014 9:59 pm

This is the latest version.
reversi-aug3.jpg
Some of the changes since last year:
  • VDP code rewritten so the main program while interrupts are enabled writes to a "command list" executed inside the interrupt handler, should hopefully never cause glitches.
  • Smart rewrites of the game board, only positions that have changed will be plotted. This speeds up the flipping quite a bit, now when we have to wait for VBL every now and then.
  • New controller: press fire thrice within your move to skip it, in case you have no legal move.
  • A number of temp variables moved to zeropage, to fit the game within 4K - currently 19 bytes to spare!
Known bugs:
  • Sometimes the sound effects (!) lock up. I shortened the error beep to reduce this bug, but also the start of game sound sometimes locks up. I need to investigate why this happens.
  • In two player mode, if either player presses fire thrice, the game ends instead of switching to the other player. This is a pure overlooking by me and hopefully easy to fix, as it works OK vs the CPU.
  • On startup, the board is plotted square by square instead of everything at once. I could probably solve this by putting more VDP calls to the list before it is executed at each vertical blank, but I didn't get the results I wanted so I think I'll leave it as it is and call it a feature. :)
  • The boot message says Creativision 1981. I might add code for a custom message, but it'd surely bring it beyond 4K for no real gain.
reversi.zip
Edit: Found another, more serious bug: When grabbing 7 squares in a row, only the last 6 will be flipped, i.e. the one furthest away from your new marker will remain unflipped. I'm not sure if this is a new bug that I've introduced, but it needs to be solved...
You do not have the required permissions to view the files attached to this post.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi

Post by MADrigal » Mon Aug 04, 2014 1:27 pm

hi man, i have got your game and will gladly test it!
what surprises me is the "introduction of new bugs" in the game engine, which worked very very well until this revision.
i originally thought that you were having problems with the vdp/interrupts issues, and that was not connected with the game engine.
anyway i'm here to help if you need :)
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Mon Aug 04, 2014 1:51 pm

Yes, the latest bug seems to be due to partial redesign of the logic display function, what I dubbed "smart rewrites". I think I have reused some bits for two different purposes, which means that the 6 frame animation of flipping pieces will be mismatched to the distance between markers, up to 7 squares. Before I went to sleep last night, I already came up with an idea how to try to fix it, so given that I have the time, it might be fixed already tonight.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: WIP: Reversi

Post by MADrigal » Mon Aug 04, 2014 1:58 pm

Bug found: in 2-players mode, I have pressed the PLAYER1-FIRE button three times and the game ended. I mean: I did not press the 1P and 2P three times each... just the P1.

About the fire buttons: I am experiencing the same problem I had with the very first games coded by Mobsie (he then solved the problem - maybe he could give you a hint?).

That is: when I keep P1 FIRE button pressed, that is in "SELECT GAME" mode, the selected game mode keeps on rolling. Wouldn't it be better to just change the game mode 1 time only, even if I keep the button pressed?
I am familiar with this problem with my Game & Watch simulators. I use an additional variable for that, and the routine looks like this:

Code: Select all

ON KEYPRESS
if buttonpressed = false then
  begin
    buttonpressed := true;
    (do what you have to do)
  end

ON KEYRELEASE
buttonpressed := false;
Hope this brings you an idea how to "fix" that issue. I would consider that a "bug" because that gives an undesired choice to the player who is selecting the game mode. In fact in the end he selects a different game because the button-press routine acts too fastly.

Obviously I am testing the game on emulator only, maybe the "bug" doesn't occur on the actual machine.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: WIP: Reversi

Post by carlsson » Mon Aug 04, 2014 2:41 pm

Yes, the skip a move in 2 player mode was already mentioned above so it is on my TODO list. The other about game selection is worth looking into, thanks.
Post Reply