Создать ответ 
 
Рейтинг темы:
  • Голосов: 0 - Средняя оценка: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Question about reading and writing data with sd card
Автор Сообщение
kof888 Не на форуме
Продвинутый
***

Сообщений: 189
Зарегистрирован: 29.06.2009
Рейтинг: 5
Сказал спасибо: 8
Поблагодарили 61 раз(а) в 27 сообщ.
Сообщение: #9
RE: Question about reading and writing data with sd card
Thank you for your reply~Big Grin

At present, I am trying to re-inject the new code into the main program of SEGA TETRIS by learning the sd.bin file

When the game is ready to try to read the file data, let it receive data directly from the SD card

After the game reads N files, the result is successful at first, but when the screen displays 3 logo picturesBig Grin

When the game program is preparing to read the Nth file, there will be a problem

The reason for the problem is that when the file is ready to be read, the cmd read command 0x51 or 0x52 is sent to the sd card, but the return value of the command will become 0xff, which is very strange, because it is normal to read N files at the beginning, but An error occurs when preparing to read N+1 files. Is this because some registers are modified by the game program? ?Blush

BTW, I have the same problem when running this game on DS

where is the latest SD card compatibility list?

I want to know if this game can run normally on sd?Huh


edit:
I found the specific address. In the following function, the following registers will be initialized.

FFE80000

FFE80004

FFE80008

FFE80018

Код:
loc_8C087876:             ! r4 =  0x1C200
        add    #-0x4, r15
        mov.l .value500, r1!  FFE80000
        mov    #0x0, r6
        mov.l .value501, r2!  FFE80018
        mov    r4, r0        
        mov.l .value502, r7!  FFE80008
        mov    #0x6, r3
        mov.l .value503, r5!  FFE80004
        mov.w    r6, @r7
        mov.w    r3, @r2
        mov.w    r6, @r1
        mov.l .value504, r1!  9600
        cmp/eq    r1, r0
        bt    loc_8C0878A8
        mov.l .value505, r1!  1C200
        cmp/eq    r1, r0
        bt    loc_8C0878AE
        mov.l .value506, r1!  38400
        cmp/eq    r1, r0
        bt    loc_8C0878B2
        mov.l .value507, r1!  70800
        cmp/eq    r1, r0
        bt    loc_8C0878B8
        bra    loc_8C0878BE
        nop
! ---------------------------------------------------------------------------

loc_8C0878A8:
        mov    #0x28, r3
        bra    loc_8C0878C0
        mov.b    r3, @r5
! ---------------------------------------------------------------------------

loc_8C0878AE:
        bra    loc_8C0878BA
        mov    #0xD, r0
! ---------------------------------------------------------------------------

loc_8C0878B2:
        mov    #0x6, r1
        bra    loc_8C0878C0
        mov.b    r1, @r5
! ---------------------------------------------------------------------------

loc_8C0878B8:
        mov    #0x2, r0

loc_8C0878BA:
        bra    loc_8C0878C0
        mov.b    r0, @r5
! ---------------------------------------------------------------------------

loc_8C0878BE:
        mov.b    r4, @r5

loc_8C0878C0:
        mov.l .value508, r4!  186A0
        bra    loc_8C0878CC
        mov.l    r6, @r15    ! 00
! ---------------------------------------------------------------------------

loc_8C0878C6:
        mov.l    @r15, r2
        add    #0x1, r2
        mov.l    r2, @r15

loc_8C0878CC:                !
        mov.l    @r15, r3
        cmp/ge    r4, r3
        bf    loc_8C0878C6
        mov.l .value501, r1!  FFE80018
        mov    #0x30, r3
        mov    #0x0, r0
        mov.w    r6, @r1
        mov.w    r3, @r7        ! FFE80008
        rts
        add    #0x4, r15


I will upload the program and image file I made laterBig Grin

Of course, we can also modify the image file ourselves

Search for the hexadecimal value of the image file:
FC7F47D1 00E645D24360

You can use the sd card to play the game on the ds

0b000900 00E645D24360

The link below is the iso file I made, download the compressed package in the link, and then decompress it to the root directory of the SD card (a bin file and an iso file).

The image is not big, only 21M after decompression

You must use an SD card greater than or equal to 4G




But you can't start the iso directly in isoldr, because I have made a lot of changes to all the files of this game, and made some optimizations for the sd card mode, so I can only run the TEST.bin file in the file manager of dreamshell

Of course, you can also use the above method to modify your own image file, so that you can directly start your own image file in isoldr



https://mega.nz/file/UGpD3YrC#iXaO4qiGHB...kcV3_107ws

test video:
https://www.bilibili.com/video/BV1xD4y1V7aP/


Thanks swat for guiding me~~~~
(Последний раз сообщение было отредактировано 05.01.2023 в 19:06, отредактировал пользователь kof888.)
05.01.2023 08:29
Найти все сообщения Цитировать это сообщение
 Сказали спасибо: fafadou
Создать ответ 


Сообщения в этой теме
RE: Question about reading and writing data with sd card - kof888 - 05.01.2023 08:29

Похожие темы
Тема: Автор Ответов: Просмотров: Посл. сообщение
  GTA3 Dreamshell SD Card/Dreamcast aldair 3 2405 26.08.2024 06:29
Посл. сообщение: SWAT
  Soul Calibur on SD card: Slow because of music aldair 1 1035 05.08.2024 14:29
Посл. сообщение: SWAT
Улыбка A few questions about using sd card kof888 5 7017 03.03.2022 12:46
Посл. сообщение: fafadou
  SD Card Адаптор для Dreamcast и запуск игр. ands 51 224548 09.04.2017 04:47
Посл. сообщение: SILENT_Pavel
  SD card mod Dreamcast. Какую флешку лучше использовать? DreamcastFANpro 18 67904 24.09.2016 08:05
Посл. сообщение: SWAT
  Проблемы с SD card DreamcastFANpro 44 126162 13.09.2016 19:50
Посл. сообщение: ands

Переход:


Пользователи просматривают эту тему: 3 Гость(ей)