void drawChar(int x, int y, char ch, unsigned short color) { int x1, y1; for(x1=0; x1<6; x1++) { for(y1=0; y1<8; y1++) { if(fontdata_6x8[OFFSET2(x1, y1, 6)+ch*48]) { setPixel(x+x1, y+y1, color); } } } }
T& Grid2<T,P1,P2>::operator()(x_size d, x_size i, x_size j) { return Grid<T,2,P1*P2>::operator()(d, OFFSET2(P1,P2,i,j)); }
int main (int /*argc*/, char ** /*argv*/) { OFFSET(Flags,Flags) OFFSET(BranchSkip,BranchSkip) OFFSET(NMIActive,NMIActive) OFFSET(IRQActive,IRQActive) OFFSET(WaitingForInterrupt,WaitingForInterrupt) OFFSET(InDMA,InDMA) OFFSET(InWRAM_DMA,InWRAM_DMA) OFFSET(WhichEvent,WhichEvent) OFFSET(PCBase,PCBase) OFFSET(PBPCAtOpcodeStart,PBPCAtOpcodeStart) OFFSET(WaitAddress,WaitAddress) OFFSET(WaitCounter,WaitCounter) OFFSET(Cycles,Cycles) OFFSET(NextEvent,NextEvent) OFFSET(V_Counter,V_Counter) OFFSET(MemSpeed,MemSpeed) OFFSET(MemSpeedx2,MemSpeedx2) OFFSET(FastROMSpeed,FastROMSpeed) OFFSET(AutoSaveTimer,AutoSaveTimer) OFFSET(SRAMModified,SRAMModified) OFFSET(BRKTriggered,BRKTriggered) OFFSET(TriedInterleavedMode2,TriedInterleavedMode2) OFFSET2(DB,DB) OFFSET2(PP,P.W) OFFSET2(PL,P.W) fprintf (S9xSTREAM, "#define PH PL + 1\n"); OFFSET2(AA,A.W) OFFSET2(AL,A.W) fprintf (S9xSTREAM, "#define AH AL + 1\n"); OFFSET2(DD,D.W) OFFSET2(DL,D.W) fprintf (S9xSTREAM, "#define DH DL + 1\n"); OFFSET2(SS,S.W) OFFSET2(SL,S.W) fprintf (S9xSTREAM, "#define SH SL + 1\n"); OFFSET2(XX,X.W) OFFSET2(XL,X.W) fprintf (S9xSTREAM, "#define XH XL + 1\n"); OFFSET2(YY,Y.W) OFFSET2(YL,Y.W) fprintf (S9xSTREAM, "#define YH YL + 1\n"); OFFSET2(PCR,PC.W.xPC) OFFSET2(PB,PC.B.xPB) OFFSET3(RAM) OFFSET3(ROM) OFFSET3(VRAM) OFFSET3(SRAM) OFFSET3(BWRAM) OFFSET3(FillRAM) OFFSET3(C4RAM) OFFSET3(HiROM) OFFSET3(LoROM) OFFSET3(SRAMMask) OFFSET3(SRAMSize) OFFSET3(Map) OFFSET3(WriteMap) OFFSET3(MemorySpeed) OFFSET3(BlockIsRAM) OFFSET3(BlockIsROM) OFFSET3(ROMFilename) OFFSET5(APUPCS,PC) OFFSET5(APURAM,RAM) OFFSET5(APUExecuting,APUExecuting) OFFSET5(APUDirectPage,DirectPage) OFFSET5(APUBit,Bit) OFFSET5(APUAddress,Address) OFFSET5(APUWaitAddress1,WaitAddress1) OFFSET5(APUWaitAddress2,WaitAddress2) OFFSET5(APUWaitCounter,WaitCounter) OFFSET5(APUShadowRAM,ShadowRAM) OFFSET5(APUCachedSamples,CachedSamples) OFFSET5(APU_Carry,_Carry) OFFSET5(APU_Zero,_Zero) OFFSET5(APU_Overflow,_Overflow) OFFSET5(APUTimerErrorCounter,TimerErrorCounter) OFFSET5(NextAPUTimerPos,NextAPUTimerPos) OFFSET4(APUCycles,Cycles) OFFSET4(APUShowROM,ShowROM) OFFSET4(APUFlags,Flags) OFFSET4(APUKeyedChannels,KeyedChannels) OFFSET4(APUOutPorts,OutPorts) OFFSET4(APUDSP,DSP) OFFSET4(APUExtraRAM,ExtraRAM) OFFSET4(APUTimer,Timer) OFFSET4(APUTimerTarget,TimerTarget) OFFSET4(APUTimerEnabled,TimerEnabled) OFFSET4(TimerValueWritten,TimerValueWritten) OFFSET6(CPUSpeed,Speed) OFFSET6(CPUOpcodes,S9xOpcodes) OFFSET6(_Carry,_Carry) OFFSET6(_Zero,_Zero) OFFSET6(_Negative,_Negative) OFFSET6(_Overflow,_Overflow) OFFSET6(ShiftedDB,ShiftedDB) OFFSET6(ShiftedPB,ShiftedPB) OFFSET6(CPUExecuting,CPUExecuting) OFFSET6(Scanline,Scanline) OFFSET6(Frame,Frame) OFFSET7(APUEnabled,APUEnabled) OFFSET7(Shutdown,Shutdown) OFFSET7(SoundSkipMethod,SoundSkipMethod) OFFSET7(CyclesPercentage,CyclesPercentage) OFFSET7(DisableIRQ,DisableIRQ) OFFSET7(Paused,Paused) OFFSET7(PAL,PAL) OFFSET7(SoundSync,SoundSync) OFFSET7(SA1Enabled,SA1) OFFSET7(SuperFXEnabled,SuperFX) OFFSET8(ApuP,P) OFFSET8(ApuYA,YA.W) OFFSET8(ApuA,YA.B.A) OFFSET8(ApuY,YA.B.Y) OFFSET8(ApuX,X) OFFSET8(ApuS,S) OFFSET8(ApuPC,PC) OFFSET8(APUPCR,PC) OFFSET9(BGMode,BGMode) OFFSET9(BG3Priority,BG3Priority) OFFSET9(Brightness,Brightness) OFFSET9(GHight,VMA.High) OFFSET9(GInc,VMA.Increment) OFFSET9(GAddress,VMA.Address) OFFSET9(GMask1,VMA.Mask1) OFFSET9(GFullGraphicCount,VMA.FullGraphicCount) OFFSET9(GShift,VMA.Shift) OFFSET9(CGFLIP,CGFLIP) OFFSET9(CGDATA,CGDATA) OFFSET9(FirstSprite,FirstSprite) OFFSET9(LastSprite,LastSprite) OFFSET9(OBJ,OBJ) OFFSET9(OAMPriorityRotation,OAMPriorityRotation) OFFSET9(OAMAddr,OAMAddr) OFFSET9(OAMFlip,OAMFlip) OFFSET9(OAMTileAddress,OAMTileAddress) OFFSET9(IRQVBeamPos,IRQVBeamPos) OFFSET9(IRQHBeamPos,IRQHBeamPos) OFFSET9(VBeamPosLatched,VBeamPosLatched) OFFSET9(HBeamPosLatched,HBeamPosLatched) OFFSET9(HBeamFlip,HBeamFlip) OFFSET9(VBeamFlip,VBeamFlip) OFFSET9(HVBeamCounterLatched,HVBeamCounterLatched) OFFSET9(MatrixA,MatrixA) OFFSET9(MatrixB,MatrixB) OFFSET9(MatrixC,MatrixC) OFFSET9(MatrixD,MatrixD) OFFSET9(CentreX,CentreX) OFFSET9(CentreY,CentreY) OFFSET9(CGADD,CGADD) OFFSET9(FixedColourGreen,FixedColourGreen) OFFSET9(FixedColourRed,FixedColourRed) OFFSET9(FixedColourBlue,FixedColourBlue) OFFSET9(SavedOAMAddr,SavedOAMAddr) OFFSET9(ScreenHeight,ScreenHeight) OFFSET9(WRAM,WRAM) OFFSET9(BG_Forced,BG_Forced) OFFSET9(ForcedBlanking,ForcedBlanking) OFFSET9(OBJThroughMain,OBJThroughMain) OFFSET9(OBJThroughSub,OBJThroughSub) OFFSET9(OBJSizeSelect,OBJSizeSelect) OFFSET9(OBJNameBase,OBJNameBase) OFFSET9(OAMReadFlip,OAMReadFlip) OFFSET9(OAMData,OAMData) OFFSET9(VTimerEnabled,VTimerEnabled) OFFSET9(HTimerEnabled,HTimerEnabled) OFFSET9(HTimerPosition,HTimerPosition) OFFSET9(Mosaic,Mosaic) OFFSET9(BGMosaic,BGMosaic) OFFSET9(Mode7HFlip,Mode7HFlip) OFFSET9(Mode7VFlip,Mode7VFlip) OFFSET9(Mode7Repeat,Mode7Repeat) OFFSET9(Window1Left,Window1Left) OFFSET9(Window1Right,Window1Right) OFFSET9(Window2Left,Window2Left) OFFSET9(Window2Right,Window2Right) OFFSET9(ClipWindowOverlapLogic,ClipWindowOverlapLogic) OFFSET9(ClipWindow1Enable,ClipWindow1Enable) OFFSET9(ClipWindow2Enable,ClipWindow2Enable) OFFSET9(ClipWindow1Inside,ClipWindow1Inside) OFFSET9(ClipWindow2Inside,ClipWindow2Inside) OFFSET9(RecomputeClipWindows,RecomputeClipWindows) OFFSET9(CGFLIPRead,CGFLIPRead) OFFSET9(OBJNameSelect,OBJNameSelect) OFFSET9(Need16x8Mulitply,Need16x8Mulitply) OFFSET9(RangeTimeOver,RangeTimeOver) OFFSET10(ColorsChanged,ColorsChanged) OFFSET10(HDMA,HDMA) OFFSET10(HDMAStarted,HDMAStarted) OFFSET10(MaxBrightness,MaxBrightness) OFFSET10(LatchedBlanking,LatchedBlanking) OFFSET10(OBJChanged,OBJChanged) OFFSET10(RenderThisFrame,RenderThisFrame) OFFSET10(SkippedFrames,SkippedFrames) OFFSET10(FrameSkip,FrameSkip) OFFSET10(TileCache,TileCache) OFFSET10(TileCached,TileCached) #ifdef CORRECT_VRAM_READS OFFSET10(VRAMReadBuffer,VRAMReadBuffer) #else OFFSET10(FirstVRAMRead,FirstVRAMRead) #endif OFFSET10(Interlace,Interlace) OFFSET10(DoubleWidthPixels,DoubleWidthPixels) OFFSET10(RenderedScreenHeight,RenderedScreenHeight) OFFSET10(RenderedScreenWidth,RenderedScreenWidth) OFFSET10(Red,Red) OFFSET10(Green,Green) OFFSET10(Blue,Blue) OFFSET10(XB,XB) OFFSET10(ScreenColors,ScreenColors) OFFSET10(PreviousLine,PreviousLine) OFFSET10(CurrentLine,CurrentLine) OFFSET10(Clip,Clip) OFFSET11(SA1Opcodes,S9xOpcodes) OFFSET11(SA1_Carry,_Carry) OFFSET11(SA1_Zero,_Zero) OFFSET11(SA1_Negative,_Negative) OFFSET11(SA1_Overflow,_Overflow) OFFSET11(SA1CPUExecuting,CPUExecuting) OFFSET11(SA1ShiftedPB,ShiftedPB) OFFSET11(SA1ShiftedDB,ShiftedDB) OFFSET11(SA1Flags,Flags) OFFSET11(SA1Executing,Executing) OFFSET11(SA1NMIActive,NMIActive) OFFSET11(SA1IRQActive,IRQActive) OFFSET11(SA1WaitingForInterrupt,WaitingForInterrupt) OFFSET11(SA1PCBase,PCBase) OFFSET11(SA1PBPCAtOpcodeStart,PBPCAtOpcodeStart) OFFSET11(SA1WaitAddress,WaitAddress) OFFSET11(SA1WaitCounter,WaitCounter) OFFSET11(SA1WaitByteAddress1,WaitByteAddress1) OFFSET11(SA1WaitByteAddress2,WaitByteAddress2) OFFSET11(SA1BWRAM,BWRAM) OFFSET11(SA1Map,Map) OFFSET11(SA1WriteMap,WriteMap) OFFSET11(SA1op1,op1) OFFSET11(SA1op2,op2) OFFSET11(SA1arithmetic_op,arithmetic_op) OFFSET11(SA1sum,sum) OFFSET11(SA1overflow,overflow) OFFSET11(VirtualBitmapFormat,VirtualBitmapFormat) OFFSET11(SA1_in_char_dma,in_char_dma) OFFSET11(SA1variable_bit_pos,variable_bit_pos) OFFSET12(SA1DB,DB) OFFSET12(SA1PP,P.W) OFFSET12(SA1PL,P.W) fprintf (S9xSTREAM, "#define SA1PH SA1PL + 1\n"); OFFSET12(SA1AA,A.W) OFFSET12(SA1AL,A.W) fprintf (S9xSTREAM, "#define SA1AH SA1AL + 1\n"); OFFSET12(SA1DD,D.W) OFFSET12(SA1DL,D.W) fprintf (S9xSTREAM, "#define SA1DH SA1DL + 1\n"); OFFSET12(SA1SS,S.W) OFFSET12(SA1SL,S.W) fprintf (S9xSTREAM, "#define SA1SH SA1SL + 1\n"); OFFSET12(SA1XX,X.W) OFFSET12(SA1XL,X.W) fprintf (S9xSTREAM, "#define SA1XH SA1XL + 1\n"); OFFSET12(SA1YY,Y.W) OFFSET12(SA1YL,Y.W) fprintf (S9xSTREAM, "#define SA1YH SA1YL + 1\n"); OFFSET12(SA1PB,PC.B.xPB) OFFSET12(SA1PCR,PC.W.xPC) return (0); }