/[pcsx2_0.9.7]/trunk/plugins/GSdx/GS.cpp
ViewVC logotype

Contents of /trunk/plugins/GSdx/GS.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (show annotations) (download)
Thu Dec 23 12:02:12 2010 UTC (9 years, 2 months ago) by william
File size: 15736 byte(s)
re-commit (had local access denied errors when committing)
1 /*
2 * Copyright (C) 2007-2009 Gabest
3 * http://www.gabest.org
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 */
21
22 #include "stdafx.h"
23 #include "GSUtil.h"
24 #include "GSRendererDX9.h"
25 #include "GSRendererDX11.h"
26 #include "GSRendererSW.h"
27 #include "GSRendererNull.h"
28 #include "GSSettingsDlg.h"
29
30
31 #define PS2E_LT_GS 0x01
32 #define PS2E_GS_VERSION 0x0006
33 #define PS2E_X86 0x01 // 32 bit
34 #define PS2E_X86_64 0x02 // 64 bit
35
36 static HRESULT s_hr = E_FAIL;
37 static GSRenderer* s_gs = NULL;
38 static void (*s_irq)() = NULL;
39 static uint8* s_basemem = NULL;
40 static int s_renderer = -1;
41 static bool s_framelimit = true;
42 static bool s_vsync = false;
43 static bool s_exclusive = true;
44
45 static bool s_IsGsOpen2 = false; // boolean to remove some stuff from the config panel in new PCSX2's/
46 static bool isdx11avail = false; // set on GSinit
47
48 EXPORT_C_(uint32) PS2EgetLibType()
49 {
50 return PS2E_LT_GS;
51 }
52
53 EXPORT_C_(char*) PS2EgetLibName()
54 {
55 return GSUtil::GetLibName();
56 }
57
58 EXPORT_C_(uint32) PS2EgetLibVersion2(uint32 type)
59 {
60 const uint32 revision = 0;
61 const uint32 build = 1;
62
63 return (build << 0) | (revision << 8) | (PS2E_GS_VERSION << 16) | (PLUGIN_VERSION << 24);
64 }
65
66 EXPORT_C_(void) PS2EsetEmuVersion(const char* emuId, uint32 version)
67 {
68 s_IsGsOpen2 = true;
69 }
70
71 EXPORT_C_(uint32) PS2EgetCpuPlatform()
72 {
73 #if _M_AMD64
74 return PS2E_X86_64;
75 #else
76 return PS2E_X86;
77 #endif
78 }
79
80 EXPORT_C GSsetBaseMem(uint8* mem)
81 {
82 s_basemem = mem;
83 if( s_gs )
84 {
85 s_gs->SetRegsMem( s_basemem );
86 }
87 }
88
89 EXPORT_C GSsetSettingsDir(const char* dir)
90 {
91 theApp.SetConfigDir(dir);
92 }
93
94 EXPORT_C_(INT32) GSinit()
95 {
96 if(!GSUtil::CheckSSE())
97 {
98 return -1;
99 }
100
101 #ifdef _WINDOWS
102
103 //_CrtSetBreakAlloc( 1273 );
104
105 s_hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
106
107 if(!GSUtil::CheckDirectX())
108 {
109 return -1;
110 }
111
112 isdx11avail = GSUtil::IsDirect3D11Available();
113
114 #endif
115
116 return 0;
117 }
118
119 EXPORT_C GSshutdown()
120 {
121 delete s_gs;
122
123 s_gs = NULL;
124 s_renderer = -1;
125
126 GSUtil::UnloadDynamicLibraries();
127
128 #ifdef _WINDOWS
129
130 if(SUCCEEDED(s_hr))
131 {
132 ::CoUninitialize();
133
134 s_hr = E_FAIL;
135 }
136
137 #endif
138 }
139
140 EXPORT_C GSclose()
141 {
142 if( !s_gs ) return;
143
144 s_gs->ResetDevice();
145
146 delete s_gs->m_dev;
147 s_gs->m_dev = NULL;
148
149 s_gs->m_wnd.Detach();
150 }
151
152 static INT32 _GSopen(void* dsp, char* title, int renderer)
153 {
154 GSDevice* dev = NULL;
155
156 if( renderer == -1 )
157 {
158 renderer = theApp.GetConfig("renderer", 0);
159 }
160
161 try
162 {
163 if (s_renderer != renderer)
164 {
165 // Emulator has made a render change request, which requires a completely
166 // new s_gs -- if the emu doesn't save/restore the GS state across this
167 // GSopen call then they'll get corrupted graphics, but that's not my problem.
168
169 delete s_gs;
170 s_gs = NULL;
171 }
172
173 switch(renderer)
174 {
175 default:
176 case 0: case 1: case 2: dev = new GSDevice9(); break;
177 case 3: case 4: case 5: dev = new GSDevice11(); break;
178 case 12: case 13: new GSDeviceNull(); break;
179 }
180
181 if( !dev ) return -1;
182
183 if( !s_gs )
184 {
185 switch(renderer)
186 {
187 default:
188 case 0: s_gs = new GSRendererDX9(); break;
189 case 3: s_gs = new GSRendererDX11(); break;
190 case 2: case 5: case 8: case 11: case 13:
191 s_gs = new GSRendererNull(); break;
192
193 case 1: case 4: case 7: case 10: case 12:
194 s_gs = new GSRendererSW(); break;
195 }
196
197 s_renderer = renderer;
198 }
199 }
200 catch( std::exception& ex )
201 {
202 // Allowing std exceptions to escape the scope of the plugin callstack could
203 // be problematic, because of differing typeids between DLL and EXE compilations.
204 // ('new' could throw std::alloc)
205
206 printf( "GSdx error: Exception caught in GSopen: %s", ex.what() );
207 return -1;
208 }
209
210 s_gs->SetRegsMem(s_basemem);
211 s_gs->SetIrqCallback(s_irq);
212 s_gs->SetVsync(s_vsync);
213 s_gs->SetFrameLimit(s_framelimit);
214
215 if( *(HWND*)dsp == NULL )
216 {
217 // old-style API expects us to create and manage our own window:
218
219 int w = theApp.GetConfig("ModeWidth", 0);
220 int h = theApp.GetConfig("ModeHeight", 0);
221
222 if(!s_gs->CreateWnd(title, w, h))
223 {
224 GSclose();
225 return -1;
226 }
227
228 s_gs->m_wnd.Show();
229 *(HWND*)dsp = (HWND)s_gs->m_wnd.GetHandle();
230 }
231 else
232 {
233 s_gs->SetMultithreaded( true );
234 s_gs->m_wnd.Attach( *(HWND*)dsp, false );
235 }
236
237 if( !s_gs->CreateDevice(dev) )
238 {
239 // This probably means the user has DX11 configured with a video card that is only DX9
240 // compliant. Cound mean drivr issues of some sort also, but to be sure, that's the most
241 // common cause of device creation errors. :) --air
242
243 GSclose();
244 return -1;
245 }
246
247 // if(mt) _mm_setcsr(MXCSR);
248
249 return 0;
250 }
251
252 EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
253 {
254 int renderer = theApp.GetConfig("renderer", 0);
255 if( flags & 4 )
256 {
257 if (isdx11avail) renderer = 4; //dx11 sw
258 else renderer = 1; //dx9 sw
259 }
260
261 INT32 retval = _GSopen( dsp, NULL, renderer );
262 s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios
263
264 return retval;
265 }
266
267 EXPORT_C_(INT32) GSopen(void* dsp, char* title, int mt)
268 {
269 int renderer;
270
271 // Legacy GUI expects to acquire vsync from the configuration files.
272 s_vsync = !!theApp.GetConfig("vsync", 0);
273
274 if(mt == 2)
275 {
276 // pcsx2 sent a switch renderer request
277 if (isdx11avail) renderer = 4; //dx11 sw
278 else renderer = 1; //dx9 sw
279 mt = 1;
280 }
281 else
282 {
283 // normal init
284 renderer = theApp.GetConfig("renderer", 0);
285 }
286
287 *(HWND*)dsp = NULL;
288
289 int retval = _GSopen(dsp, title, renderer);
290
291 if( retval == 0 && s_gs )
292 {
293 s_gs->SetMultithreaded( !!mt );
294 }
295
296 return retval;
297 }
298
299 EXPORT_C GSreset()
300 {
301 s_gs->Reset();
302 }
303
304 EXPORT_C GSgifSoftReset(uint32 mask)
305 {
306 s_gs->SoftReset(mask);
307 }
308
309 EXPORT_C GSwriteCSR(uint32 csr)
310 {
311 s_gs->WriteCSR(csr);
312 }
313
314 EXPORT_C GSreadFIFO(uint8* mem)
315 {
316 s_gs->ReadFIFO(mem, 1);
317 }
318
319 EXPORT_C GSreadFIFO2(uint8* mem, uint32 size)
320 {
321 s_gs->ReadFIFO(mem, size);
322 }
323
324 EXPORT_C GSgifTransfer(const uint8* mem, uint32 size)
325 {
326 s_gs->Transfer<3>(mem, size);
327 }
328
329 EXPORT_C GSgifTransfer1(uint8* mem, uint32 addr)
330 {
331 s_gs->Transfer<0>(const_cast<uint8*>(mem) + addr, (0x4000 - addr) / 16);
332 }
333
334 EXPORT_C GSgifTransfer2(uint8* mem, uint32 size)
335 {
336 s_gs->Transfer<1>(const_cast<uint8*>(mem), size);
337 }
338
339 EXPORT_C GSgifTransfer3(uint8* mem, uint32 size)
340 {
341 s_gs->Transfer<2>(const_cast<uint8*>(mem), size);
342 }
343
344 EXPORT_C GSvsync(int field)
345 {
346 #ifdef _WINDOWS
347
348 if( s_gs->m_wnd.IsManaged() )
349 {
350 MSG msg;
351
352 memset(&msg, 0, sizeof(msg));
353
354 while(msg.message != WM_QUIT && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
355 {
356 TranslateMessage(&msg);
357 DispatchMessage(&msg);
358 }
359 }
360 #endif
361
362 s_gs->VSync(field);
363 }
364
365 EXPORT_C_(uint32) GSmakeSnapshot(char* path)
366 {
367 string str = string(path);
368 if (str[str.length() - 1] != '\\')
369 str = str + "\\";
370 return s_gs->MakeSnapshot(str + "gsdx");
371 }
372
373 EXPORT_C GSkeyEvent(GSKeyEventData* e)
374 {
375 s_gs->KeyEvent(e);
376 }
377
378 EXPORT_C_(int) GSfreeze(int mode, GSFreezeData* data)
379 {
380 if(mode == FREEZE_SAVE)
381 {
382 return s_gs->Freeze(data, false);
383 }
384 else if(mode == FREEZE_SIZE)
385 {
386 return s_gs->Freeze(data, true);
387 }
388 else if(mode == FREEZE_LOAD)
389 {
390 return s_gs->Defrost(data);
391 }
392
393 return 0;
394 }
395
396 EXPORT_C GSconfigure()
397 {
398 if( !GSUtil::CheckSSE() ) return;
399
400 if( GSSettingsDlg( s_IsGsOpen2 ).DoModal() == IDOK )
401 {
402 if( s_gs != NULL && s_gs->m_wnd.IsManaged() )
403 {
404 // Legacy apps like gsdxgui expect this...
405 GSshutdown();
406 }
407 }
408 }
409
410 EXPORT_C_(INT32) GStest()
411 {
412 if(!GSUtil::CheckSSE())
413 {
414 return -1;
415 }
416
417 #ifdef _WINDOWS
418
419 s_hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
420
421 if(!GSUtil::CheckDirectX())
422 {
423 if(SUCCEEDED(s_hr))
424 ::CoUninitialize();
425
426 s_hr = E_FAIL;
427
428 return -1;
429 }
430
431 if(SUCCEEDED(s_hr))
432 ::CoUninitialize();
433
434 s_hr = E_FAIL;
435
436 #endif
437
438 return 0;
439 }
440
441 EXPORT_C GSabout()
442 {
443 }
444
445 EXPORT_C GSirqCallback(void (*irq)())
446 {
447 s_irq = irq;
448 if( s_gs )
449 {
450 s_gs->SetIrqCallback(s_irq);
451 }
452 }
453
454 EXPORT_C_(int) GSsetupRecording(int start, void* data)
455 {
456 if(!s_gs) return 0;
457
458 if(start & 1)
459 s_gs->BeginCapture();
460 else
461 s_gs->EndCapture();
462
463 return 1;
464 }
465
466 EXPORT_C GSsetGameCRC(uint32 crc, int options)
467 {
468 s_gs->SetGameCRC(crc, options);
469 }
470
471 EXPORT_C GSgetLastTag(uint32* tag)
472 {
473 s_gs->GetLastTag(tag);
474 }
475
476
477 #ifdef _MSC_VER
478 #define snprintf _snprintf
479 #endif
480
481 EXPORT_C GSgetTitleInfo2(char* dest, size_t length)
482 {
483 if (!s_gs->m_GStitleInfoBuffer[0])
484 strcpy(dest, "GSdx");
485 else
486 {
487 EnterCriticalSection(&s_gs->m_pGSsetTitle_Crit);
488 snprintf(dest, length-1, "GSdx | %s", s_gs->m_GStitleInfoBuffer);
489 dest[length-1] = 0; // just in case!
490 LeaveCriticalSection(&s_gs->m_pGSsetTitle_Crit);
491 }
492 }
493
494 EXPORT_C GSsetFrameSkip(int frameskip)
495 {
496 s_gs->SetFrameSkip(frameskip);
497 }
498
499 EXPORT_C GSsetVsync(int enabled)
500 {
501 s_vsync = !!enabled;
502 if( s_gs )
503 s_gs->SetVsync(s_vsync);
504 }
505
506 EXPORT_C GSsetExclusive(int enabled)
507 {
508 s_exclusive = !!enabled;
509 if( s_gs )
510 s_gs->SetVsync(s_vsync);
511 }
512
513 EXPORT_C GSsetFrameLimit(int limit)
514 {
515 s_framelimit = !!limit;
516 if( s_gs )
517 s_gs->SetFrameLimit(s_framelimit);
518 }
519
520 #ifdef _WINDOWS
521
522 // Returns false if the window's been closed or an invalid packet was encountered.
523 static __forceinline bool LoopDatPacket_Thingamajig(HWND hWnd, uint8 (&regs)[0x2000], vector<uint8>& buff, FILE* fp, long start)
524 {
525 switch(fgetc(fp))
526 {
527 case EOF:
528 fseek(fp, start, 0);
529 return !!IsWindowVisible(hWnd);
530
531 case 0:
532 {
533 uint32 index = fgetc(fp);
534 uint32 size;
535
536 fread(&size, 4, 1, fp);
537
538 switch(index)
539 {
540 case 0:
541 {
542 if(buff.size() < 0x4000) buff.resize(0x4000);
543 uint32 addr = 0x4000 - size;
544 fread(&buff[0] + addr, size, 1, fp);
545 GSgifTransfer1(&buff[0], addr);
546 }
547 break;
548
549 case 1:
550 if(buff.size() < size) buff.resize(size);
551 fread(&buff[0], size, 1, fp);
552 GSgifTransfer2(&buff[0], size / 16);
553 break;
554
555 case 2:
556 if(buff.size() < size) buff.resize(size);
557 fread(&buff[0], size, 1, fp);
558 GSgifTransfer3(&buff[0], size / 16);
559 break;
560 }
561 }
562 break;
563
564 case 1:
565 GSvsync(fgetc(fp));
566 return !!IsWindowVisible(hWnd);
567
568 case 2:
569 {
570 uint32 size;
571 fread(&size, 4, 1, fp);
572 if(buff.size() < size) buff.resize(size);
573 GSreadFIFO2(&buff[0], size / 16);
574 }
575 break;
576
577 case 3:
578 fread(regs, 0x2000, 1, fp);
579 break;
580
581 default:
582 return false;
583 }
584
585 return true;
586 }
587
588 // lpszCmdLine:
589 // First parameter is the renderer.
590 // Second parameter is the gs file to load and run.
591 EXPORT_C GSReplay(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
592 {
593 int renderer = -1;
594
595 {
596 char* start = lpszCmdLine;
597 char* end = NULL;
598 long n = strtol(lpszCmdLine, &end, 10);
599 if(end > start) {renderer = n; lpszCmdLine = end;}
600 }
601
602 while(*lpszCmdLine == ' ') lpszCmdLine++;
603
604 ::SetPriorityClass(::GetCurrentProcess(), HIGH_PRIORITY_CLASS);
605
606 vector<uint8> buff;
607
608 if(FILE* fp = fopen(lpszCmdLine, "rb"))
609 {
610 GSinit();
611
612 uint8 regs[0x2000];
613 GSsetBaseMem(regs);
614
615 s_vsync = !!theApp.GetConfig("vsync", 0);
616
617 HWND hWnd = NULL;
618 _GSopen(&hWnd, "", renderer);
619
620 uint32 crc;
621 fread(&crc, 4, 1, fp);
622 GSsetGameCRC(crc, 0);
623
624 GSFreezeData fd;
625 fread(&fd.size, 4, 1, fp);
626 fd.data = new uint8[fd.size];
627 fread(fd.data, fd.size, 1, fp);
628 GSfreeze(FREEZE_LOAD, &fd);
629 delete [] fd.data;
630
631 fread(regs, 0x2000, 1, fp);
632
633 long start = ftell(fp);
634
635 GSvsync(1);
636
637 while( LoopDatPacket_Thingamajig(hWnd, regs, buff, fp, start) ) ;
638
639 GSclose();
640 GSshutdown();
641
642 fclose(fp);
643 }
644 }
645
646 EXPORT_C GSBenchmark(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
647 {
648 ::SetPriorityClass(::GetCurrentProcess(), HIGH_PRIORITY_CLASS);
649
650 FILE* file = fopen("c:\\log.txt", "a");
651
652 fprintf(file, "-------------------------\n\n");
653
654 if(1)
655 {
656 GSLocalMemory mem;
657
658 static struct {int psm; const char* name;} s_format[] =
659 {
660 {PSM_PSMCT32, "32"},
661 {PSM_PSMCT24, "24"},
662 {PSM_PSMCT16, "16"},
663 {PSM_PSMCT16S, "16S"},
664 {PSM_PSMT8, "8"},
665 {PSM_PSMT4, "4"},
666 {PSM_PSMT8H, "8H"},
667 {PSM_PSMT4HL, "4HL"},
668 {PSM_PSMT4HH, "4HH"},
669 {PSM_PSMZ32, "32Z"},
670 {PSM_PSMZ24, "24Z"},
671 {PSM_PSMZ16, "16Z"},
672 {PSM_PSMZ16S, "16ZS"},
673 };
674
675 uint8* ptr = (uint8*)_aligned_malloc(1024 * 1024 * 4, 16);
676
677 for(int i = 0; i < 1024 * 1024 * 4; i++) ptr[i] = (uint8)i;
678
679 //
680
681 for(int tbw = 5; tbw <= 10; tbw++)
682 {
683 int n = 256 << ((10 - tbw) * 2);
684
685 int w = 1 << tbw;
686 int h = 1 << tbw;
687
688 fprintf(file, "%d x %d\n\n", w, h);
689
690 for(int i = 0; i < countof(s_format); i++)
691 {
692 const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[s_format[i].psm];
693
694 GSLocalMemory::writeImage wi = psm.wi;
695 GSLocalMemory::readImage ri = psm.ri;
696 GSLocalMemory::readTexture rtx = psm.rtx;
697 GSLocalMemory::readTexture rtxP = psm.rtxP;
698
699 GIFRegBITBLTBUF BITBLTBUF;
700
701 BITBLTBUF.SBP = 0;
702 BITBLTBUF.SBW = w / 64;
703 BITBLTBUF.SPSM = s_format[i].psm;
704 BITBLTBUF.DBP = 0;
705 BITBLTBUF.DBW = w / 64;
706 BITBLTBUF.DPSM = s_format[i].psm;
707
708 GIFRegTRXPOS TRXPOS;
709
710 TRXPOS.SSAX = 0;
711 TRXPOS.SSAY = 0;
712 TRXPOS.DSAX = 0;
713 TRXPOS.DSAY = 0;
714
715 GIFRegTRXREG TRXREG;
716
717 TRXREG.RRW = w;
718 TRXREG.RRH = h;
719
720 GSVector4i r(0, 0, w, h);
721
722 GIFRegTEX0 TEX0;
723
724 TEX0.TBP0 = 0;
725 TEX0.TBW = w / 64;
726
727 GIFRegTEXA TEXA;
728
729 TEXA.TA0 = 0;
730 TEXA.TA1 = 0x80;
731 TEXA.AEM = 0;
732
733 int trlen = w * h * psm.trbpp / 8;
734 int len = w * h * psm.bpp / 8;
735
736 clock_t start, end;
737
738 _ftprintf(file, _T("[%4s] "), s_format[i].name);
739
740 start = clock();
741
742 for(int j = 0; j < n; j++)
743 {
744 int x = 0;
745 int y = 0;
746
747 (mem.*wi)(x, y, ptr, trlen, BITBLTBUF, TRXPOS, TRXREG);
748 }
749
750 end = clock();
751
752 fprintf(file, "%6d %6d | ", (int)((float)trlen * n / (end - start) / 1000), (int)((float)(w * h) * n / (end - start) / 1000));
753
754 start = clock();
755
756 for(int j = 0; j < n; j++)
757 {
758 int x = 0;
759 int y = 0;
760
761 (mem.*ri)(x, y, ptr, trlen, BITBLTBUF, TRXPOS, TRXREG);
762 }
763
764 end = clock();
765
766 fprintf(file, "%6d %6d | ", (int)((float)trlen * n / (end - start) / 1000), (int)((float)(w * h) * n / (end - start) / 1000));
767
768 const GSOffset* o = mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM);
769
770 start = clock();
771
772 for(int j = 0; j < n; j++)
773 {
774 (mem.*rtx)(o, r, ptr, w * 4, TEXA);
775 }
776
777 end = clock();
778
779 fprintf(file, "%6d %6d ", (int)((float)len * n / (end - start) / 1000), (int)((float)(w * h) * n / (end - start) / 1000));
780
781 if(psm.pal > 0)
782 {
783 start = clock();
784
785 for(int j = 0; j < n; j++)
786 {
787 (mem.*rtxP)(o, r, ptr, w, TEXA);
788 }
789
790 end = clock();
791
792 fprintf(file, "| %6d %6d ", (int)((float)len * n / (end - start) / 1000), (int)((float)(w * h) * n / (end - start) / 1000));
793 }
794
795 fprintf(file, "\n");
796
797 fflush(file);
798 }
799
800 fprintf(file, "\n");
801 }
802
803 _aligned_free(ptr);
804 }
805
806 //
807
808 if(0)
809 {
810 GSLocalMemory mem;
811
812 uint8* ptr = (uint8*)_aligned_malloc(1024 * 1024 * 4, 16);
813
814 for(int i = 0; i < 1024 * 1024 * 4; i++) ptr[i] = (uint8)i;
815
816 const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[PSM_PSMCT32];
817
818 GSLocalMemory::writeImage wi = psm.wi;
819
820 GIFRegBITBLTBUF BITBLTBUF;
821
822 BITBLTBUF.DBP = 0;
823 BITBLTBUF.DBW = 32;
824 BITBLTBUF.DPSM = PSM_PSMCT32;
825
826 GIFRegTRXPOS TRXPOS;
827
828 TRXPOS.DSAX = 0;
829 TRXPOS.DSAY = 1;
830
831 GIFRegTRXREG TRXREG;
832
833 TRXREG.RRW = 256;
834 TRXREG.RRH = 256;
835
836 int trlen = 256 * 256 * psm.trbpp / 8;
837
838 int x = 0;
839 int y = 0;
840
841 (mem.*wi)(x, y, ptr, trlen, BITBLTBUF, TRXPOS, TRXREG);
842 }
843
844 //
845
846 fclose(file);
847 PostQuitMessage(0);
848 }
849
850 #endif

  ViewVC Help
Powered by ViewVC 1.1.22