Videopac / Odyssey2 forum
September 22, 2021, 07:44:10 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: If you have some news and you want it to be shown here, pm Janzl!
 
   Home   Help Login Register links videopac.nl  
Pages: [1]   Go Down
  Print  
Author Topic: Help from the codingexperts needed: MOVES in my code don't work.  (Read 287 times)
dr beep
Played Munchkin once...
**
Posts: 65


« on: June 11, 2021, 11:52:24 AM »


I am having trouble doing moves in my shogun game.
I have reduced the code to set up and 2 moves only.

R6 and R4 are set to move from a field (R6) to a field (R4).
The first move goes ok, but the second is not.
When I swap the moves, the second (who now is first) goes ok, but the other not.

I have added in a zip-file, 2 versions with moves swapped and the registers
as they are when the debugger goes to display stones (3x, set up, move1 and move2)
and the debugger for the move-routine, 2x. Only difference are the R4/R6.

If someone could make both moves work then I can finish the game, Computer-AI is working, but the move is not.

BTW: the moves are fictional, no legal moves in the game.

Source and compiled text are added too.

So why is my second move not working?

Here is a downloadlink with all the info
https://www.mediafire.com/file/tk77282gf4vizy6/shogun.zip/file
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #1 on: June 11, 2021, 12:00:24 PM »

BTW : Press T to sTart the boarddisplay.
Logged
TedFoolery
Attacked the Timelord
***
Posts: 101


« Reply #2 on: June 11, 2021, 06:40:31 PM »

I honestly don't know why it's not working, but if you turn the gfx off before the second move, it works. This is from shogmiin01:
; here computermove starts
   call gfxoff
   call 00ech       ; eram access
   mov r4,#057h      
   mov r6,#041h
Logged
TedFoolery
Attacked the Timelord
***
Posts: 101


« Reply #3 on: June 11, 2021, 07:35:46 PM »

Actually, ignore the previous comment. I think the issue is in the display routine. Reverse the ext. ram enable and the gfxoff:
dlp1   call 00ech       ; eram access
   call gfxoff      ; turn graphics off so we can move stuff


should be:
dlp1   call gfxoff      ; turn graphics off so we can move stuff
   call 00ech       ; eram access
Logged
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2723



« Reply #4 on: June 12, 2021, 05:07:58 PM »

Fortunately we have people with a lot of knowledge here, like Ted, Manopac, etc
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #5 on: June 12, 2021, 08:03:52 PM »

I will add the fix.

The info I had was only for VDC-acces graphics had to be off.

I need graphics on to keep the background, but during the move it can be switched off, it is only a short moment.

I was away on a 4 days roadtrip for my work and during a boatcrossing I was able to make the zip-file. In this way I now have the solution already when I got home.

Thanks...
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!