-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMapper_0.c
81 lines (72 loc) · 2.41 KB
/
Mapper_0.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include "Mapper_0.h"
/*===================================================================*/
/* */
/* Mapper 0 */
/* */
/*===================================================================*/
/*-------------------------------------------------------------------*/
/* Initialize Mapper 0 */
/*-------------------------------------------------------------------*/
void Mapper_0_Init() {
int nPage;
/* Set ROM Banks */
if ((NesHeader.byRomSize * 2) > 3) {
ROMBANK0 = ROMPAGE( 0 );
ROMBANK1 = ROMPAGE( 1 );
ROMBANK2 = ROMPAGE( 2 );
ROMBANK3 = ROMPAGE( 3 );
} else if ((NesHeader.byRomSize * 2) > 1) {
ROMBANK0 = ROMPAGE( 0 );
ROMBANK1 = ROMPAGE( 1 );
ROMBANK2 = ROMPAGE( 0 );
ROMBANK3 = ROMPAGE( 1 );
} else {
ROMBANK0 = ROMPAGE( 0 );
ROMBANK1 = ROMPAGE( 0 );
ROMBANK2 = ROMPAGE( 0 );
ROMBANK3 = ROMPAGE( 0 );
}
/* Set PPU Banks */
// if ( NesHeader.byVRomSize > 0 ) {
for ( nPage = 0; nPage < 8; ++nPage )
PPUBANK[ nPage ] = &VROM[ nPage * 0x400 ];
// }
/* Set up wiring of the interrupt pin */
K6502_Set_Int_Wiring( 1, 1 );
}
/*-------------------------------------------------------------------*/
/* Mapper 0 Write Function */
/*-------------------------------------------------------------------*/
unsigned char Mapper_0_Read( uint16 wAddr ) {
return (wAddr >> 8);
}
/*-------------------------------------------------------------------*/
/* Mapper 0 Write Function */
/*-------------------------------------------------------------------*/
void Mapper_0_Write( uint16 wAddr, unsigned char byData )
{
/*
* Dummy Write to Mapper
*
*/
}
/*-------------------------------------------------------------------*/
/* Mapper 0 V-Sync Function */
/*-------------------------------------------------------------------*/
void Mapper_0_VSync()
{
/*
* Dummy Callback at VSync
*
*/
}
/*-------------------------------------------------------------------*/
/* Mapper 0 H-Sync Function */
/*-------------------------------------------------------------------*/
void Mapper_0_HSync()
{
/*
* Dummy Callback at HSync
*
*/
}