任天堂产品系统介绍(doc 30页)(正式版)

内容发布更新时间 : 2024/5/8 11:07:50星期一 下面是文章的全部内容请认真阅读。

EOF 10、任天堂磁碟机系统

任天堂家庭机磁碟系统(FDS)是它的扩展单位,它只是由任天堂公司生产以及只在亚洲国家销售。它有一个软盘驱动器可以插2.5寸软盘,可以以32KB的RAM(代替了ROM)来读进程序。8KB的VRAM(代替了VROM),其他的硬件描述于下。

内存映像:

FDS的地址空间的描述:

$0000 2kB InternalRAM, mirrored 4 times $2000 Input/Output $5000 Expansion Modules $6000 32kB Program RAM $E000 8kB FDS BIOS ROM FDS还增加了一些I/O端口于$4000-$40FF来控制磁盘系统,声音系统,IRQ记数器。

读写/端口 功能描述 位 $4020 W $4021 W $4022 W 2 Lower Byte of IRQ Counter Upper Byte of IRQ Counter Enable/Disable IRQs \\ = Stop IRQ counter and reset its interrupt request / = Load IRQ counter with a value from $4020-$4021 and start it Data Write Register:To write data to the disk, output it into this register Control Register Drive Motor, 0 = on, 1 = off \\ = Set drive head to the start of the first track Disk Write, 0 = enabled, 1 = disabled Screen Mirroring, 0 = vertical, 1 = horizontal Disk IRQs, 0 = disabled, 1 = enabled ExPort Output (???) $4024 W $4025 W 0 1 2 3 7 $4026 W 4-6 Unknown (???) $4030 R 4 6 Disk Status Register 0 Unknown (???) Unknown (???) Data Read Register:To read data from the disk, input it from this register Disk Status Register 1 Disk Presence, 0 = inserted, 1 = not inserted Disk Ready, 0 = ready, 1 = not ready Write Protection, 0 = unprotected, 1 = protected ExPort Input Battery Status, 0 = ok, 1 = low $4031 R $4032 R 0 1 2 $4033 R 7 可屏蔽中断计数器:

FDS提供了一个16位的IRQ记数器连接到CPU时钟发生器。计数器开始于你写在$4021的一个预设在$4020-$4021的值。它在每个CPU时钟周期后减一。当计数器为零时,它从预设的值开始继续计数。这时就发生了一个IRQ。当垂直空白时,屏幕刷新时也会发生。$4022的第2个位用来控制IRQ计数器。当它是0,那么计数停止,要到达的IRQ被复位(如果有的话)。设置了1后,记数可以被恢复。

磁碟格式:

每个磁盘有两面,A 和 B,每面可以有65000字节的数据。要反转一个当前面,必须先拿出来,反转,重新插回去。数据在每个面上被储存于一系列的不同类型的块[1,2,3,4,3,4,...,3,4]。 Block 1. Side Header Block(56 bytes) 2. File Number Block Byte Description 0 $01 1-14 \15 20 21 Maker ID Version Number Side Number, $00 = Side A, $01 = Side B 16-19 Side Name 22-Additional Disk Data 24 25 0 $08 $02 26-56 Reserved Space (not used by BIOS) (2 bytes) 3. File Header Block (16 bytes) 4. File Data Block (variable length) 1 0 1-2 Number of Files on this side $03 File Number (not used by BIOS?) 3-10 File Name (not used by BIOS?) 11-12 Starting Address in memory 13-14 File Size 15 0 File Type:$00= Program Data,$01 = Character Data,$02 = Screen Data $04 1-... Data (see File Header Block for size) 所以两字节地方都以最重要的字节开始。面的名称可能和相同游戏软盘的不同面不同,但它们是一样的。当文件被读取,开始的地址在RAM和VRAM都是实在的地址。

磁碟访问:

下面的图表显示了FDS如何从软盘中读/写。 READ:

$4025 A B C D E A)Initialization 7bit _ __ _ - --_ B) Motor on 6bit _ __ - - --_ C) Read start mark 5bit - -- - - --- D) Enable IRQs 4bit _ __ _ _ _-_ E) Read end mark 2bit - -- - - --- 1. Read data, ($4030)=[xx0xxxxx] 1bit - -_ _ _ ___ 2. Read data, ($4030)=[xxx0xxxx] 0bit _ -- - - --_ Note 1 2 WRITE:

$4025 A B C D E A)Initialization 7bit _ __ __ - --_ B) Motor on 6bit _ __ _- - --_ C) Write start mark 5bit - -- -- - --- D) Enable IRQs 4bit _ __ __ _ _-_ E) Write end mark 2bit - -- __ _ __- 1. Delay, write [00000000] 1bit - -_ __ _ ___ 2. Write [10000000] 0bit _ -- -- - --_ 3. Write data, ($4030)=[xx0xxxxx] Note 1 2 34 4. Delay 对于读写是如何完成的并不清楚。虽然知道FDS每当一个字节从软盘里读出的时候就发生一个IRQ。FDS的IRQ处理器(是FDS的BIOS一部分)在$4031读取这个字节,然后指针指向下个字节。 磁碟错误:

下面是软盘错误的信息: ERR Meaning 01 No disk 02 No power 03 Broken prong on the disk 04 Wrong maker ID 05 Wrong game name 06 Wrong game version 07 Wrong side number (flip the disk) 08 Wrong disk #1 09 Wrong disk #2 10 Wrong disk #3 11 12 13 14 15 16 17 18 19 Allows it to recognize screen data differs 20 (???) 21 Wrong Side Header Block (\22 Wrong Side Header Block ID ($01) 23 Wrong File Number Block ID ($02) 24 Wrong File Header Block ID ($03) 25 Wrong File Data Block ID ($04) 注释 没有软盘 没有电源 ?? ?? 不正确的游戏名字 不正确的游戏版本 不正确的盘面(反转之) 一号软盘错 二号软盘错 三号软盘错 ?? 不正确的盘面柱头块 不正确的盘面柱头块号 不正确的文件块号 不正确的文件头块号 不正确的文件数据块号 26 Error writing data to the disk 27 Block ends prematurely The disk unit and the same period can't take 28 it(???) The disk unit and the same period can't take 29 it (???) 30 Disk full 31 Data number of a disk doesn't match up (???)

写文件错 块过早结束 ?? ?? 软盘满 ??

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4 ceshi