1 /* 2 * nes_ppu.h 3 * 4 * emulation interface for NES PPU 5 */ 6 7 /* $Id: nes_ppu.h,v 1.23 2001/03/16 19:05:30 nyef Exp $ */ 8 9 #ifndef NES_PPU_H 10 #define NES_PPU_H 11 12 #ifndef NES_H 13 #include "nes.h" 14 #endif 15 16 typedef struct nes_ppu *nes_ppu; 17 extern nes_ppu nes_ppu_true; 18 19 /* this include must come after the typedef for nes_ppu */ 20 #ifndef MAPPERS_H 21 #include "mappers.h" 22 #endif 23 24 /* PPU control */ 25 void PPU_mirror_horizontal(void); 26 void PPU_mirror_vertical(void); 27 void PPU_mirror_one_low(void); 28 void PPU_mirror_one_high(void); 29 int nesppu_periodic(nes_ppu ppu); 30 void nesppu_set_mapper(nes_ppu ppu, nes_mapper mapper); 31 32 /* PPU memory initialization */ 33 void PPU_init(nes_rom romfile); 34 35 /* PPU memory mapping */ 36 void nesppu_map_1k(nes_ppu ppu, int bank, int page); 37 void nesppu_map_2k(nes_ppu ppu, int bank, int page); 38 void nesppu_map_4k(nes_ppu ppu, int bank, int page); 39 void nesppu_map_8k(nes_ppu ppu, int bank, int page); 40 41 /* PPU functions */ 42 void PPU_render_video_frame(void); 43 44 /* PPU I/O */ 45 void ppu_io_write(nes_ppu ppu, unsigned short addr, unsigned char value); 46 unsigned char ppu_io_read(nes_ppu ppu, unsigned short addr); 47 48 /* PPU debug output */ 49 void PPU_dump_memory(short address); 50 void PPU_dump_pattern(short address); 51 52 /* PPU nametables */ 53 extern unsigned char *PPU_nametables[4]; 54 55 /* PPU sprite RAM */ 56 extern unsigned char PPU_sprite_ram[0x100]; 57 58 /* support for mappers that use latches */ 59 typedef void (* ppulatch_t)(nes_mapper mapper, unsigned short address); 60 extern ppulatch_t ppu_latchfunc; 61 62 /* support for paged CHR RAM */ 63 void nesppu_paged_ram_init(int num_8k_pages); 64 void nesppu_paged_ram_mode(int enabled); 65 66 #endif /* NES_PPU_H */ 67 68 /* 69 * $Log: nes_ppu.h,v $ 70 * Revision 1.23 2001/03/16 19:05:30 nyef 71 * removed long-disused definitions of PPU_enter_cpu() and PPU_leave_cpu() 72 * 73 * Revision 1.22 2000/10/09 16:37:50 nyef 74 * added preliminary support for paged CHR RAM 75 * 76 * Revision 1.21 2000/10/05 08:55:28 nyef 77 * fixed the redundant include guard for mappers.h to use the correct symbol 78 * 79 * Revision 1.20 2000/10/05 08:37:35 nyef 80 * moved sprite DMA handling from nes_ppu.c to nes.c 81 * 82 * Revision 1.19 2000/10/05 08:29:15 nyef 83 * fixed the idempotency code to not violate ANSI quite so flagrantly 84 * 85 * Revision 1.18 2000/05/07 02:12:31 nyef 86 * added "extern" to some variable declarations 87 * 88 * Revision 1.17 1999/12/04 04:54:10 nyef 89 * removed useless include of emu6502.h 90 * 91 * Revision 1.16 1999/11/20 05:38:28 nyef 92 * rebuilt romfile handling 93 * 94 * Revision 1.15 1999/11/16 02:14:22 nyef 95 * removed PPU_banks[] and PPU_bank_XX (obsolete interface) 96 * 97 * Revision 1.14 1999/11/15 04:05:12 nyef 98 * implemented preliminary version of new CHR ROM mapping interface 99 * 100 * Revision 1.13 1999/11/14 16:20:25 nyef 101 * fixed latch function interface to work with new mapper interface 102 * 103 * Revision 1.12 1999/11/14 07:00:13 nyef 104 * changed to use new mapper interface 105 * 106 * Revision 1.11 1999/06/05 02:52:31 nyef 107 * added prototype for nesppu_periodic() 108 * 109 * Revision 1.10 1999/05/29 22:31:47 nyef 110 * started reorganizing the NES PPU 111 * 112 * Revision 1.9 1999/02/14 18:29:40 nyef 113 * added function prototypes required for I/O access 114 * 115 * Revision 1.8 1999/01/02 00:41:53 nyef 116 * added PPU_banks for mappers that find it easier to index through that. 117 * 118 * Revision 1.7 1999/01/01 21:47:40 nyef 119 * added PPU_nametables for mappers that need to modify them by hand. 120 * 121 * Revision 1.6 1998/12/11 04:33:57 nyef 122 * fixed for full compatability with cal. 123 * 124 * Revision 1.5 1998/10/01 02:34:00 nyef 125 * added preliminary support for latches as per mappers 9 and 10 126 * 127 * Revision 1.4 1998/08/30 17:03:17 nyef 128 * removed PPU_use_vrom in favor of a more general ppu_flags setup. 129 * 130 * Revision 1.3 1998/08/29 22:11:25 nyef 131 * removed reference to PPU_video_buffer. (no longer used) 132 * 133 * Revision 1.2 1998/07/18 21:43:57 nyef 134 * added support for one-screen mirroring 135 * 136 * Revision 1.1 1998/07/11 22:18:15 nyef 137 * Initial revision 138 * 139 */ 140