FS#8961 - Anti-Aliased Fonts.
[kugel-rb/myfork.git] / apps / codecs / libasap / asap_internal.h
blob1385215f37b37192ed03b9f3901b2c275f452ae3
1 /*
2 * asap_internal.h - private interface of the ASAP engine
4 * Copyright (C) 2005-2008 Piotr Fusik
6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net
9 * ASAP is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License,
12 * or (at your option) any later version.
14 * ASAP is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 * See the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #ifndef _ASAP_INTERNAL_H_
25 #define _ASAP_INTERNAL_H_
27 #if !defined(JAVA) && !defined(CSHARP)
29 #include "asap.h"
31 #define CONST_LOOKUP(type, name) \
32 static const type name[]
33 #define FILE_FUNC static
34 #define ASAP_FUNC
35 #define PTR *
36 #define ADDRESSOF &
37 #define ARRAY *
38 #define VOIDPTR void *
39 #define UBYTE(data) (data)
40 #define SBYTE(data) (signed char) (data)
41 #define STRING const char *
42 #define ZERO_ARRAY(array) memset(array, 0, sizeof(array))
43 #define COPY_ARRAY(dest, dest_offset, src, src_offset, len) \
44 memcpy(dest + dest_offset, src + src_offset, len)
45 #define NEW_ARRAY(type, name, size) \
46 type name[size]
47 #define INIT_ARRAY(array) memset(array, 0, sizeof(array))
49 #define AST ast->
50 #define PST pst->
51 #define MODULE_INFO module_info->
52 #define ASAP_OBX const byte *
53 #define GET_OBX(name) name##_obx
55 int ASAP_GetByte(ASAP_State *ast, int addr);
56 void ASAP_PutByte(ASAP_State *ast, int addr, int data);
58 void Cpu_RunScanlines(ASAP_State *ast, int scanlines);
60 void PokeySound_Initialize(ASAP_State *ast);
61 void PokeySound_StartFrame(ASAP_State *ast);
62 void PokeySound_PutByte(ASAP_State *ast, int addr, int data);
63 int PokeySound_GetRandom(ASAP_State *ast, int addr);
64 void PokeySound_EndFrame(ASAP_State *ast, int cycle_limit);
65 int PokeySound_Generate(ASAP_State *ast, byte buffer[], int buffer_offset, int blocks, ASAP_SampleFormat format);
66 abool PokeySound_IsSilent(const PokeyState *pst);
67 void PokeySound_Mute(const ASAP_State *ast, PokeyState *pst, int mask);
69 #ifdef ASAPSCAN
70 abool call_6502_player(ASAP_State *ast);
71 extern abool cpu_trace;
72 void print_cpu_state(const ASAP_State *ast, int pc, int a, int x, int y, int s, int nz, int vdi, int c);
73 #endif
75 #endif /* !defined(JAVA) && !defined(CSHARP) */
77 #define ASAP_MAIN_CLOCK 1773447
79 #define V_FLAG 0x40
80 #define D_FLAG 0x08
81 #define I_FLAG 0x04
82 #define Z_FLAG 0x02
84 #define NEVER 0x800000
86 #define dGetByte(addr) UBYTE(AST memory[addr])
87 #define dPutByte(addr, data) AST memory[addr] = (byte) (data)
88 #define dGetWord(addr) (dGetByte(addr) + (dGetByte((addr) + 1) << 8))
89 #define GetByte(addr) (((addr) & 0xf900) == 0xd000 ? ASAP_GetByte(ast, addr) : dGetByte(addr))
90 #define PutByte(addr, data) do { if (((addr) & 0xf900) == 0xd000) ASAP_PutByte(ast, addr, data); else dPutByte(addr, data); } while (FALSE)
91 #define RMW_GetByte(dest, addr) do { if (((addr) >> 8) == 0xd2) { dest = ASAP_GetByte(ast, addr); AST cycle--; ASAP_PutByte(ast, addr, dest); AST cycle++; } else dest = dGetByte(addr); } while (FALSE)
93 #endif /* _ASAP_INTERNAL_H_ */