forked from alemorf/retro_computers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
157 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
; ПЗУ Океан 240.2 REV 8 / Реверсинжиниринг [email protected] / Лицензия GPL | ||
; Прочитать сектор с дискеты | ||
; Вход: a - диск, c - Код команды для К1818ВГ93 | ||
; Вход: a - номер дисковода, c - код команды для К1818ВГ93 | ||
; Выход: a - код ошибки, cf - если была ошибка | ||
|
||
FloppyRead: | ||
push psw | ||
|
||
; Выбор дисковода и головки | ||
push psw | ||
call FloppySetDriveHead | ||
pop psw | ||
|
||
; Если необходимо, то перезагрузить К1818ВГ93. Установить дорожку и сектор. | ||
call FloppyReinitSetTrackSector | ||
; Запуск двигателя. Выбор дорожки и сектора. | ||
call FloppyStartMotorSetTrackSector | ||
#ifndef CONFIG_FLOPPY_SIZE_OPTIMIZATION | ||
jc Return | ||
|
||
#else | ||
rc | ||
#endif | ||
; Отправка команды в К1818ВГ93, получение блока данных из К1818ВГ93 | ||
call FloppyReadInteral | ||
#ifndef CONFIG_FLOPPY_SIZE_OPTIMIZATION | ||
jc Return | ||
|
||
; Возврат кода ошибки 0 | ||
#else | ||
rc | ||
#endif | ||
; Выход с кодом ошибки 0 | ||
xra a | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
; ПЗУ Океан 240.2 REV 8 / Реверсинжиниринг [email protected] / Лицензия GPL | ||
; Запустить двигатель дисковода | ||
; Вход: b - дисковод | ||
; Выход: a - код ошибки, cf - если была ошибка | ||
|
||
FloppyStartMotor: | ||
; Если выбран другой дисковод, то нужна задержка на раскрутку | ||
mov b, a | ||
lda v_floppy_current | ||
cmp b | ||
jz loc_FE6B | ||
call FloppyStartMotor2 | ||
ret | ||
loc_FE6B: | ||
|
||
; Если двигатель выключен, то запустить двигатель | ||
in PORT_FLOPPY | ||
rlc | ||
jc FloppyStartMotor2 | ||
|
||
; Если дисковод не готов, то запустить двигатель | ||
in PORT_VG93_COMMAND | ||
ani 80h ; Not ready | ||
rz | ||
|
||
;---------------------------------------------------------------------------- | ||
|
||
FloppyStartMotor2: | ||
push b | ||
|
||
; Значение для задержки на раскрутку | ||
lxi b, 0FFFFh | ||
|
||
; Короткий негативный импульс на INIT запускает двигатель | ||
call FloppyToggleInit | ||
|
||
; Ожидаение готовности дисковода или остановки двигателя по таймауту | ||
loc_FE7D: in PORT_VG93_COMMAND | ||
ani 80h ; Not ready | ||
jz loc_FE8F | ||
in PORT_FLOPPY | ||
rlc | ||
jnc loc_FE7D | ||
|
||
; Таймаут. Выход с кодом ошибки. | ||
mvi a, 20h | ||
jmp loc_FE95 | ||
|
||
; Задержка на раскрутку | ||
loc_FE8F: dcx b | ||
mov a, b | ||
ora a | ||
jnz loc_FE8F | ||
|
||
loc_FE95: | ||
pop b | ||
ret | ||
|
||
;---------------------------------------------------------------------------- | ||
|
||
FloppyToggleInit: | ||
; Установка 0 на линии INIT | ||
in PORT_FLOPPY | ||
ani 4Eh | ||
rar | ||
out PORT_FLOPPY | ||
|
||
; Установка 1 на линии INIT | ||
ori PFE_NEG_INIT | ||
out PORT_FLOPPY | ||
ret |
20 changes: 20 additions & 0 deletions
20
Ocean_240/firmware_source/floppystartmotorsettracksector.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; ПЗУ Океан 240.2 REV 8 / Реверсинжиниринг [email protected] / Лицензия GPL | ||
; Запустить двигатель. Установить дорожку и сектор. | ||
; Вход: a - дисковод | ||
; Выход: a - код ошибки, cf - если была ошибка | ||
|
||
FloppyStartMotorSetTrackSector: | ||
; Запустить двигатель | ||
call FloppyStartMotor | ||
rc | ||
|
||
; Установить дорожку и сектор | ||
#ifndef CONFIG_FLOPPY_SIZE_OPTIMIZATION | ||
call FloppySetTrackSector | ||
rc | ||
ret | ||
#else | ||
jmp FloppySetTrackSector | ||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
; ПЗУ Океан 240.2 REV 8 / Реверсинжиниринг [email protected] / Лицензия GPL | ||
; Записать сектор на дискету | ||
; Вход: a - Диск, c - Код команды для К1818ВГ93 | ||
; Вход: a - номер дисковода, c - код команды для К1818ВГ93 | ||
; Выход: a - код ошибки, cf - если была ошибка | ||
|
||
FloppyWrite: | ||
|
@@ -9,14 +9,20 @@ FloppyWrite: | |
call FloppySetDriveHead | ||
pop psw | ||
|
||
; Если необходимо, то перезагрузить К1818ВГ93. Установить дорожку и сектор. | ||
call FloppyReinitSetTrackSector | ||
; Запуск двигателя. Выбор дорожки и сектора. | ||
call FloppyStartMotorSetTrackSector | ||
#ifndef CONFIG_FLOPPY_SIZE_OPTIMIZATION | ||
jc Return | ||
|
||
#else | ||
rc | ||
#endif | ||
; Отправка команды в К1818ВГ93, отправка блока данных в К1818ВГ93 | ||
call FloppyWriteInternal | ||
#ifndef CONFIG_FLOPPY_SIZE_OPTIMIZATION | ||
jc Return | ||
|
||
; Возврат кода ошибки 0 | ||
#else | ||
rc | ||
#endif | ||
; Выход с кодом ошибки 0 | ||
xra a | ||
ret |
Oops, something went wrong.