one | Title | Data | Data Name | No |
typedef struct BupConfig {
Uint16 unit_id; /* Unit ID */
Uint16 partition; /* number of partitions */
} BupConfig;
Equipment type | unit_id | partition |
|---|---|---|
Built-in memory | 1 | 1 |
external cartridge | 2 | 1 |
one | Title | Data | Data Name | No |
typedef struct BupStat {
Uint32 totalsize; /* Total capacity() */
Uint32 totalblock; /* Number of blocks */
Uint32 blocksize; /* 1 block size() */
Uint32 freesize; /* Free space */
Uint32 freeblock; /* Number of free blocks */
Uint32 datanum; /* Number of writable items */
} BupStat;
one | Title | Data | Data Name | No |
typedef struct BupDate {
Uint8 year; /* Year (1980 subtracted from the Western calendar) */
Uint8 month; /* Month (1-12) */
Uint8 day; /* day (1-31) */
Uint8 time; /* Hour (0~23) */
Uint8 min; /* minutes (0-59) */
Uint8 week; /* Day of the week (Sun 0 - Sat 6) */
} BupDate;
one | Title | Data | Data Name | No |
typedef struct BupDir {
Uint8 filename[12]; /* filename */
/* (11 ASCII characters + NUL, total 12 bytes) */
Uint8 comment[11]; /* Comment */
/* (10 ASCII characters + NUL, total 11 bytes) */
Uint8 language; /* Language type of comment */
/* Japanese: BUP_JAPANESE */
/* English: BUP_ENGLISH */
/* French: BUP_FRANCAIS */
/* German: BUP_DEUTSCH */
/* Spanish: BUP_ESPANOL */
/* Italian: BUP_ITALIANO */
Uint32 date; /* date time data */
Uint32 datasize; /* Data size (unit: bytes) */
Uint16 blocksize; /* Data size (unit: block) */
} BupDir;
one | Title | Func | Function | No |
device number | Equipment type |
|---|---|
0 | Built-in memory cartridge |
1 | Memory cartridge or parallel interface |
2 | serial interface |
#define BUP_START_ADDR 0x6??????
#include "sega_bup.h"
Uint32 workmemory[2048+30];
void sample()
{
BupConfig conf[3];
BUP_Init(BUP_START_ADDR, workmemory, conf);
......
}
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
dir: File management information (input other than dir.blocksize) data: Pointer to write data owsw: Overwrite check mode ON: Do not write if a file with the same name exists. OFF: If a file with the same name exists, it will be overwritten.
function value | meaning |
|---|---|
0 | success |
BUP_NON | disconnected |
BUP_UNFORMAT | unformatted |
BUP_WRITE_PROTECT | With write protection |
BUP_FOUND | A file with the same name exists. |
other | failure |
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
function value | meaning |
|---|---|
0 | success |
BUP_NON | disconnected |
BUP_UNFORMAT | unformatted |
BUP_NOT_FOUND | file not found |
BUP_BROKEN | file is corrupted |
other | failure |
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
function value | meaning |
|---|---|
0 | success |
BUP_NON | disconnected |
BUP_UNFORMAT | unformatted |
BUP_NOT_FOUND | file not found |
BUP_WRITE_PROTECT | With write protection |
other | failure |
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
one | Title | Func | Function | No |
device number | Storage device |
|---|---|
0 | Built-in memory |
1 | Memory cartridge or parallel interface |
2 | serial interface |
function value | meaning |
|---|---|
0 | success |
BUP_NON | disconnected |
BUP_UNFORMAT | unformatted |
BUP_NO_MATCH | data doesn't match |
BUP_NOT_FOUND | file not found |
BUP_BROKEN | file is corrupted |
one | Title | Func | Function | No |
one | Title | Func | Function | No |
★ PROGRAMMER'S GUIDE ★ Backup Library User's Manual