Skip to content

Commit

Permalink
feat: device driver and file system
Browse files Browse the repository at this point in the history
devdrv.mac: add `REQHEAD_ReadData`, `DPBv1_*`, `CURDIR_*`, `MEDIABYTE_*` and `DIRENT_*`.
filesys.mac: add `FILES_EX_*`.
  • Loading branch information
kg68k committed Jul 30, 2024
1 parent a0a696c commit 9d92958
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 14 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# 変更履歴

## 3.3.0 (2024-07-31)

* devdrv.mac: `REQHEAD_ReadData``DPBv1_*``CURDIR_*``MEDIABYTE_*``DIRENT_*`を追加。
* dosdef.mac: `MB_*`は将来削除する可能性あり。
* filesys.mac: `FILES_EX_*`を追加。
* `FILES_Path`は将来削除する可能性あり。


## 3.2.2 (2024-02-08)

* doscall.mac: `_SUSPEND`ではなく`_SUSPEND_PR`が正式なシンボル名と解釈し、これを先頭に戻した。
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,5 @@ without any warranty.


## Author

TcbnErik / 立花@桑島技研


TcbnErik / 立花@桑島技研
https://github.com/kg68k/ruka-macro
91 changes: 88 additions & 3 deletions src/devdrv.mac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.nlist

;devdrv.mac - RUKA assembler macro for X680x0/Human68k(v3) by TcbnErik
;Last-modified: 2024-02-07
;Last-modified: 2024-07-31
;
;Copying and distribution of this file, with or without modification,
;are permitted in any medium without royalty provided the copyright
Expand Down Expand Up @@ -102,7 +102,8 @@ REQHEAD_FileAttribute: .equ $0d ;.b in cmd$46,$47,$49
REQHEAD_SeekMode: .equ $0d ;.b in cmd$4e
REQHEAD_LockMode: .equ $0d ;.b in cmd$58
REQHEAD_UnitCount: .equ $0d ;.b out cmd$00,$40
REQHEAD_DriveStatus: .equ $0d ;.b out cmd$05,$51
REQHEAD_DriveStatus: .equ $0d ;.b out block:cmd$05,$51
REQHEAD_ReadData: .equ $0d ;.b out char:cmd$05

REQHEAD_Buffer: .equ $0e ;.l in cmd$03,$04,$08,$09,$0c,$13,$4c,$4d,$50,$52,$53,$54,$55
REQHEAD_Namests: .equ $0e ;.l in cmd$41,$42,$43,$45,$46,$47,$49,$4a
Expand Down Expand Up @@ -208,9 +209,93 @@ DPB_DirschFind_Offset: .ds 1
sizeof_DPB:
.fail $.ne.56

.offset 0
DPBv1_Drive: .ds.b 1
DPBv1_UnitNo: .ds.b 1
DPBv1_BytesPerSector: .ds 1
DPBv1_SectorsPerCluster: .ds.b 1
DPBv1_ClusterToSecShift: .ds.b 1
DPBv1_FatStartSector: .ds 1
DPBv1_FatCount: .ds.b 1
DPBv1_SectorsPerFat: .ds.b 1
DPBv1_RootEntryCount: .ds 1
DPBv1_DataStartSector: .ds 1
DPBv1_FatMax: .ds 1
DPBv1_RootDirStartSector: .ds 1
DPBv1_DeviceHeader: .ds.l 1
DPBv1_MediaByte: .ds.b 1
DPBv1_IsClean: .ds.b 1
DPBv1_NextDpb: .ds.l 1
DPBv1_CurDirFat .ds 1
DPBv1_CurDir: .ds.b 64
sizeof_DPBv1:
.fail $.ne.94

* Current Directory Table --------------------- *

.offset 0
CURDIR_Drive: .ds.b 2
CURDIR_Path: .ds.b 64
.ds.w 1
.ds.b 1
CURDIR_Assign: .ds.b 1
CURDIR_Dpb: .ds.l 1
CURDIR_Fat: .ds 1
CURDIR_Length: .ds 1
sizeof_CURDIR:
.fail $.ne.78

* Media Byte ---------------------------------- *

MEDIABYTE_2DD10: .equ $e0 ;9scdrv.x
MEDIABYTE_1D9: .equ $e5 ;
MEDIABYTE_2D9: .equ $e6 ;
MEDIABYTE_1D8: .equ $e7 ;
MEDIABYTE_2D8: .equ $e8 ;
MEDIABYTE_2DQ16: .equ $e9 ;
MEDIABYTE_2HT: .equ $ea ;
MEDIABYTE_2HS: .equ $eb ;
MEDIABYTE_2HDE: .equ $ec ;
MEDIABYTE_1DD9: .equ $ee ;
MEDIABYTE_1DD8: .equ $ef ;
MEDIABYTE_DMF: .equ $f0 ;

MEDIABYTE_WINDRV: .equ $f3 ;windrv
MEDIABYTE_DAT: .equ $f4
MEDIABYTE_NFS: .equ $f4 ;nfs.x
MEDIABYTE_CDROM: .equ $f5
MEDIABYTE_MO: .equ $f6
MEDIABYTE_HD: .equ $f7
MEDIABYTE_SASI: .equ $f8
MEDIABYTE_RAMDISK: .equ $f9
MEDIABYTE_2HQ: .equ $fa
MEDIABYTE_2DD8: .equ $fb
MEDIABYTE_2DD9: .equ $fc
MEDIABYTE_2HC: .equ $fd
MEDIABYTE_2HD: .equ $fe

* Directory Entry ----------------------------- *

sizeof_DIRENT_Name1: .equ 8
sizeof_DIRENT_Ext: .equ 3
sizeof_DIRENT_Name2: .equ 10

.offset 0
DIRENT_Name1: .ds.b 8
DIRENT_Ext: .ds.b 3
DIRENT_Atr: .ds.b 1
DIRENT_Name2: .ds.b 10
DIRENT_Time: .ds 1
DIRENT_Date: .ds 1
DIRENT_Fat: .ds 1
DIRENT_Size: .ds.l 1
sizeof_DIRENT:
.fail $.ne.32

* End of File --------------------------------- *

.text
.endif

* End of File --------------------------------- *

.list
9 changes: 6 additions & 3 deletions src/dosdef.mac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.nlist

;dosdef.mac - RUKA assembler macro for X680x0/Human68k(v3) by TcbnErik
;Last-modified: 2023-12-04
;Last-modified: 2024-07-31
;
;Copying and distribution of this file, with or without modification,
;are permitted in any medium without royalty provided the copyright
Expand Down Expand Up @@ -190,6 +190,7 @@ ENV_MAX: .equ 256
DRIVE_MAX: .equ 26
.endif

.ifndef __RUKA_DISABLE_OBSOLETE_MACRO__
MB_2DD10: .equ $e0
MB_1D9: .equ $e5
MB_2D9: .equ $e6
Expand All @@ -212,6 +213,7 @@ MB_2DD8: .equ $fb
MB_2DD9: .equ $fc
MB_2HC: .equ $fd
MB_2HD: .equ $fe
.endif


* User Macro ---------------------------------- *
Expand All @@ -236,8 +238,9 @@ TO_USER2: .macro
.endm


* End of File --------------------------------- *

.text
.endif

* End of File --------------------------------- *

.list
21 changes: 17 additions & 4 deletions src/filesys.mac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.nlist

;filesys.mac - RUKA assembler macro for X680x0/Human68k(v3) by TcbnErik
;Last-modified: 2023-12-04
;Last-modified: 2024-07-31
;
;Copying and distribution of this file, with or without modification,
;are permitted in any medium without royalty provided the copyright
Expand Down Expand Up @@ -98,6 +98,11 @@ sizeof_FCB:

* FILES buffer -------------------------------- *

sizeof_FILES_EX_Path: .equ 65
sizeof_FILES_EX_Name1: .equ 8
sizeof_FILES_EX_Ext: .equ 3
sizeof_FILES_EX_Name2: .equ 10

.offset 0
FILES_SchAtr: .ds.b 1
FILES_SchDrv: .ds.b 1
Expand All @@ -113,7 +118,14 @@ FILES_FileSize: .ds.l 1
FILES_FileName: .ds.b 23
sizeof_FILES:
.fail $.ne.53
FILES_Path: .ds.b 88 ;only extended mode
.ifndef __RUKA_DISABLE_OBSOLETE_MACRO__
FILES_Path:
.endif
FILES_EX_Drive: .ds.b 2
FILES_EX_Path: .ds.b sizeof_FILES_EX_Path
FILES_EX_Name1: .ds.b sizeof_FILES_EX_Name1
FILES_EX_Ext: .ds.b sizeof_FILES_EX_Ext
FILES_EX_Name2: .ds.b sizeof_FILES_EX_Name2
sizeof_FILES_EX:
.fail $.ne.141

Expand Down Expand Up @@ -150,8 +162,9 @@ sizeof_NAMECK:
.fail $.ne.91


* End of File --------------------------------- *

.text
.endif

* End of File --------------------------------- *

.list

0 comments on commit 9d92958

Please # to comment.