Disabling auto-refresh of game list by default, as it is causing bugs sometimes
[open-ps2-loader.git] / modules / iopcore / cdvdman / atad.h
blob23dc52cfb148b74b00e0d6528001e44ac6be4d69
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
10 # $Id: atad.h 629 2004-10-11 00:45:00Z mrbrown $
11 # ATA Device Driver definitions and imports.
14 #ifndef IOP_ATAD_H
15 #define IOP_ATAD_H
17 #include "types.h"
18 #include "irx.h"
20 /* These are used with the dir parameter of ata_device_dma_transfer(). */
21 #define ATA_DIR_READ 0
22 #define ATA_DIR_WRITE 1
24 typedef struct _ata_devinfo {
25 int exists; /* Was successfully probed. */
26 int has_packet; /* Supports the PACKET command set. */
27 u32 total_sectors; /* Total number of user sectors. */
28 u32 security_status;/* Word 0x100 of the identify info. */
29 } ata_devinfo_t;
31 int atad_start(void);
32 ata_devinfo_t * ata_get_devinfo(int device);
33 int ata_io_start(void *buf, u32 blkcount, u16 feature, u16 nsector, u16 sector,
34 u16 lcyl, u16 hcyl, u16 select, u16 command);
35 int ata_io_finish(void);
36 int ata_get_error(void);
37 int ata_device_dma_transfer(int device, void *buf, u32 lba, u32 nsectors, int dir);
39 // APA Partition
40 #define APA_MAGIC 0x00415041 // 'APA\0'
41 #define APA_IDMAX 32
42 #define APA_MAXSUB 64 // Maximum # of sub-partitions
43 #define APA_PASSMAX 8
44 #define APA_FLAG_SUB 0x0001
45 #define APA_MBR_VERSION 2
47 typedef struct {
48 u8 unused;
49 u8 sec;
50 u8 min;
51 u8 hour;
52 u8 day;
53 u8 month;
54 u16 year;
55 } ps2time;
57 typedef struct // size = 1024
59 u32 checksum; // HDL uses 0xdeadfeed magic here
60 u32 magic;
61 char gamename[160];
62 u8 compat_flags;
63 u8 pad[3];
64 char startup[60];
65 u32 layer1_start;
66 u32 discType;
67 int num_partitions;
68 struct {
69 u32 part_offset; // in MB
70 u32 data_start; // in sectors
71 u32 part_size; // in KB
72 } part_specs[65];
73 } hdl_apa_header;
75 #endif /* IOP_ATAD_H */