📄 mem.h
字号:
/*
Copyright (C) 2001 Jesper Hansen <jesperh@telia.com>.
Rewritten by: Nikolai Vorontsov <nickviz@mail.be>
This file is part of the yampp system.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __MEM_H__
#define __MEM_H__
#include "types.h"
#include "Constants.h"
// 32 k External RAM
#define EXTRAM_START 0x260
#define EXTRAM_END 0x7FFF
// 3 bytes _before_ LONG_NAME are also used!!!
#define LONG_NAME ((u08*)0x0300) // length 256
#define DIR_NAME ((u08*)0x0400) // length 256
#define TMP_SECTOR ((u08*)0x0500) // length 512
#define FAT_CACHE ((u08*)0x0700) // length 512
#define LETTER_TABLE 0x0900 // length 26 * 3 = 78
//free from 0x0900+78 - 0x1FFF
// This is the size of each buffer which is allocated for disk IO
// It should be 512 <= BUFFER_SIZE <=8192 and CLUSTER_SIZE should be
// divided by it without reminder
#define BUFFER_SIZE 2048
#define BUFFER1 0x2000
#define BUFFER2 (BUFFER1 + BUFFER_SIZE)
#define BUFFER1P ((u08*)BUFFER1)
#define BUFFER2P ((u08*)BUFFER2)
#if BUFFER_SIZE < 512 || BUFFER_SIZE > 8192 || BUFFER_SIZE % 512 != 0
#error Invalid BUFFER_SIZE!
#endif
#if BUFFER_SIZE > CLUSTER_SIZE || CLUSTER_SIZE % BUFFER_SIZE != 0
#error Invalid pair CLUSTER_SIZE, BUFFER_SIZE!
#endif
// eeprom positions
#define EEPROM_VOLUME 0x0010 /* u08 */
#define EEPROM_AUTOPLAY 0x0011 /* u08 */
#define EEPROM_RANDOM 0x0012 /* u08 */
#define EEPROM_MAXLETTERS 0x0013 /* u08 */
#define EEPROM_SONGPOS 0x0014 /* u16 */
#define EEPROM_MAXSONGS 0x0016 /* u16 */
#define EEPROM_FREECLUST1 0x0018 /* u32 */
#define EEPROM_FREECLUST2 0x001A /* -"- */
#define EEPROM_LOUDNESS 0x001C /* u08 */
#define EEPROM_ORDER 0x001D /* 26 * 3 bytes */
struct LT_elem
{
u16 song_num;
u08 letter;
};
#define LetterTable ((struct LT_elem*)LETTER_TABLE)
#define MAX_LETTERS 26
void eeprom_ww(u08 address, u16 value);
#endif // __MEM_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -