Auteur Sujet: M2Pac : Comment convertir un Daytona USA "correctement"  (Lu 40233 fois)

Hors ligne BigPanik

  • Hi-Score Buster
  • *
  • Messages: 3199
  • Localisation: Carrières Sur Seine (78)
    • Voir le profil
M2Pac : Comment convertir un Daytona USA "correctement"
« Réponse #240 le: Samedi 01 Septembre 2018, 00:40:57 am »
  • The uln deliver the +5v


    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #241 le: Mardi 18 Septembre 2018, 01:43:22 am »
  • Right so I’ve managed to get it almost fully working.

    Input Buttons, pedals & steering are fully working.

    Light output is fully working.

    By the drive board I’m unsure about.

    So when I turn it on it runs a self check and the motor spins. After a little while the clutch slowly lets the steering wheel move before the motor changes direction.

    Once it’s finished it’s check the ffb sits displaying  - - until I can plug the serial usb into the laptop and open your program. I can see the display reads the pot at 82.

    Once I start the game the and it’s at the menu the wheel starts pulling to one side that appears very odd.

    Here’s a video -
    Any ideas?



    Hors ligne BigPanik

    • Hi-Score Buster
    • *
    • Messages: 3199
    • Localisation: Carrières Sur Seine (78)
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #242 le: Mardi 18 Septembre 2018, 07:46:50 am »
  • What I see:
    - board init seems ok
    - Feedback potentiometer seems ok
    - command byte from pc to the board seems BAD

    Try:
    1/ launch m2dump.exe after m2emu + daytona
    2/ film the m2dump screen to show me the data sent to the board
    3/ check the 8 pins from arduino to drive board
    4/ do you have a common 0v between arduino and drive board?

    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #243 le: Mardi 18 Septembre 2018, 21:54:17 pm »
  • Good evening,

    Here’s the latest video -
    So both the drive board and arduino share a 5v power supply.

    I was taking the +5v for pin 10 on the drive board directly from the power supply. After some trial and error it turns out that’s want was causing the random behavior. Now I have taken the +5v for pin 10 directly from the arduino the ran down behavior has stopped.

    The m2dump only displays FF. This happend before with the problem and now again without.

    It’s so close now I can’t wait 😊

    Hors ligne BigPanik

    • Hi-Score Buster
    • *
    • Messages: 3199
    • Localisation: Carrières Sur Seine (78)
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #244 le: Mardi 18 Septembre 2018, 22:58:46 pm »
  • FF is not normal on m2dump. It is a software issue.
    Are you using the correct version of m2emu: v1.1a?

    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #245 le: Mercredi 19 Septembre 2018, 00:31:35 am »
  • I doubled checked and I am using 1.1a -



    I also tried on windows xp -




    I also grabbed another rom from the net to test with no luck.

    I don’t need an extra script like I did for the light output do I?


    Hors ligne BigPanik

    • Hi-Score Buster
    • *
    • Messages: 3199
    • Localisation: Carrières Sur Seine (78)
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #246 le: Mercredi 19 Septembre 2018, 07:48:20 am »
  • 32 or 64bits? I never try on 32.

    Hors ligne onfre

    • Grand Pilier
    • *
    • Messages: 775
    • Localisation: Nantes
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #247 le: Mercredi 19 Septembre 2018, 08:05:40 am »
  • When everything will work, would you please make a complete list of what is needed to create another machine like yours ? Thank you!

    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #248 le: Mercredi 19 Septembre 2018, 10:30:24 am »
  • @BigPanik the windows 10 laptop is 64 and the xp laptop was 32bit. I’ve got a windows 7 laptop at work I’ll try it on later today that’s also 64 bit. I’ll download all the files from the web rather than copying what I have. Is there any debug feature in m2 dump?



    @onfre yeah sure :)

    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #249 le: Mercredi 19 Septembre 2018, 14:39:38 pm »
  • So it would appear the problem is with the daytonas.lua script.





    Lamp script was working but when I took the photo x wasn’t displayed as it flashes.

    I will test again at home on windows 10 but as soon as I add the script I get not ffb output.

    Could the script have been updated?

    Does anyone have a copy of the working one?
    « Modifié: Mercredi 19 Septembre 2018, 14:42:10 pm par gareth_iowc »

    Hors ligne BigPanik

    • Hi-Score Buster
    • *
    • Messages: 3199
    • Localisation: Carrières Sur Seine (78)
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #250 le: Mercredi 19 Septembre 2018, 22:29:30 pm »
  • Daytonas.lua
    require("model2"); -- Import model2 machine globals

    function Init()
    Patch_SpecialInputs();
    Patch_LampOutputs();
    end

    function Patch_SpecialInputs()
    -- first, disable old read
    Romset_PatchDWord(0, 0x1E504, 0x5CA01E00); -- MOV g4,0x00 (NOOP?)

    -- now jump to our patched read
    Romset_PatchDWord(0, 0x1E508, 0x090219F8); -- CALL 0x0003FF00

    -- read io port
    Romset_PatchDWord(0, 0x3FF00, 0x80A03000);
    Romset_PatchDWord(0, 0x3FF04, 0x01C00012); -- LDOB g4,0x01C00012

    -- read patched mask
    Romset_PatchDWord(0, 0x3FF08, 0x80B83000);
    Romset_PatchDWord(0, 0x3FF0C, 0x00500820); -- LDOB g7,0x00500820

    -- and em
    Romset_PatchDWord(0, 0x3FF10, 0x58A50097); -- AND g4,g4,g7

    -- restore old mask
    Romset_PatchDWord(0, 0x3FF14, 0x8CB800FF); -- LDA g7,0xff

    -- return
    Romset_PatchDWord(0, 0x3FF18, 0x0A000000);  -- RET
    end

    function Patch_LampOutputs()
    -- reroute 0x01C0001E to 0x00500824
    for offset = 0x00000000, 0x0003FFFF, 4 do
    if Romset_ReadDWord(0, offset) == 0x01C0001E then
    Romset_PatchDWord(0, offset, 0x00500824);
    local opcode = offset - 1;
    if Romset_ReadByte(0, opcode) == 0x80 then
    Romset_PatchByte(0, opcode, 0x90) -- replace LDOB with LD
    end
    if Romset_ReadByte(0, opcode) == 0x82 then
    Romset_PatchByte(0, opcode, 0x92) -- replace STOB with ST
    end
    end
    end
    end

    function PostDraw()
    if I960_ReadByte(RAMBASE + 0x00000820) == 0x00 then
    I960_WriteByte(RAMBASE + 0x00000820, 0xFF);
    end

    -- 0xFF = normal
    -- 0xFD = force beginner
    -- 0xFB = force advanced
    -- 0xF9 = force expert

    -- 0xF7 = emergency/remote start

    -- 0x7F = ex.start; found in shematics but don't yet know what it does

    -- 0x3E = DIK_F4
    -- 0x3E = DIK_F5
    local data = 0xFF;
    data = XOR(SHL(Input_IsKeyPressed(0x3E), 0x07), data); -- F4 for ex.start
    data = XOR(SHL(Input_IsKeyPressed(0x3F), 0x03), data);  -- F5 for emergency/remote start
    I960_WriteByte(RAMBASE + 0x00000820, data);

    Video_DrawText(0,0,HEX8(I960_ReadByte(0x00500824)),0xFFFFFF);
    end

    But the lua script only interact on the lamps. FFB command work without any script.

    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #251 le: Mardi 25 Septembre 2018, 21:42:14 pm »
  • what comms method/protocol is used between the Arduino and the drive board?


    Hors ligne BigPanik

    • Hi-Score Buster
    • *
    • Messages: 3199
    • Localisation: Carrières Sur Seine (78)
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #252 le: Mardi 25 Septembre 2018, 23:02:57 pm »
  • No protocol, the command byte is received via serial usb and directly transfert to port A 8 bits/pins port.

    Hors ligne yngbld

    • Nouveau
    • *
    • Messages: 2
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #253 le: Mercredi 10 Octobre 2018, 02:54:24 am »
  • Hello BP

    I'm from Australia so not sure if this automatically translates across or you can read English lets hope :-). I'm am interested in starting this project as i have been wanting to build a Daytona for many years and finally have the time. I have very little electronics background so reading this post time and time again is slowly beginning to make sense so thankyou!. I have obtained a model 2 steering wheel console and and am about to source a drive board. Before i do so i wish to understand how to power the board up? and to which pins. Firstly can you suggest a power supply that will step down 110v from our 240 supply here in Australia and what specific Amperage to power the board,  secondly indicate where the power pins (if i have missed this on an original post ) are located on the board.  I apologize if this seems elementary. Thank you in advance

    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #254 le: Vendredi 12 Octobre 2018, 20:55:21 pm »
  • good evening BigPanik

    so sadly it looks like i've got a bad drive board


    So i put together a small board so i could see if the Arduino was outputting via port a.

    It looks like i'm getting an output ok so i'm assuming it's just a bad driveboard.

    I am struggling to find one but as soon as i can get one i shall continue

    :)

    Hors ligne gareth_iowc

    • Intéressé
    • *
    • Messages: 21
      • Voir le profil
    M2Pac : Comment convertir un Daytona USA "correctement"
    « Réponse #255 le: Vendredi 12 Octobre 2018, 21:00:11 pm »
  • Hello BP

    I'm from Australia so not sure if this automatically translates across or you can read English lets hope :-). I'm am interested in starting this project as i have been wanting to build a Daytona for many years and finally have the time. I have very little electronics background so reading this post time and time again is slowly beginning to make sense so thankyou!. I have obtained a model 2 steering wheel console and and am about to source a drive board. Before i do so i wish to understand how to power the board up? and to which pins. Firstly can you suggest a power supply that will step down 110v from our 240 supply here in Australia and what specific Amperage to power the board,  secondly indicate where the power pins (if i have missed this on an original post ) are located on the board.  I apologize if this seems elementary. Thank you in advance

    Welcome yngbld,

    This project is not easy and it would appear you've over looked some information already published about the pinouts.

    Please have a good read of page 15 as most of the information you require is there.

    This step down works great for me  -https://www.ebay.co.uk/itm/70W-AC-Voltage-Converter-70-Watt-220V-230V-240V-Step-Down-Japan-100V-110V-120V/183366793979?hash=item2ab1833afb:g:u5sAAOSwHxFbamcF:rk:33:pf:0