Commit 81c43b4d authored by Donald Haase's avatar Donald Haase
Browse files

Initial commit of NesterDC SE 1.0 and the builder. libdreamscript is separated out

parents
# NesterDC SE Makefile
# by Scherzo
TARGET = nesterdcse.elf
ORIG_MAPPER_OBJS = mapper/000.o mapper/001.o mapper/002.o mapper/003.o mapper/004.o
ORIG_MAPPER_OBJS += mapper/005.o mapper/006.o mapper/007.o mapper/008.o mapper/009.o
ORIG_MAPPER_OBJS += mapper/010.o mapper/011.o mapper/013.o mapper/015.o mapper/016.o
ORIG_MAPPER_OBJS += mapper/017.o mapper/018.o mapper/019.o mapper/020.o mapper/021.o
ORIG_MAPPER_OBJS += mapper/022.o mapper/023.o mapper/024.o mapper/025.o mapper/026.o
ORIG_MAPPER_OBJS += mapper/032.o mapper/033.o mapper/034.o mapper/040.o mapper/041.o
ORIG_MAPPER_OBJS += mapper/042.o mapper/043.o mapper/044.o mapper/045.o mapper/046.o
ORIG_MAPPER_OBJS += mapper/047.o mapper/048.o mapper/049.o mapper/050.o mapper/051.o
ORIG_MAPPER_OBJS += mapper/052.o mapper/057.o mapper/058.o mapper/060.o mapper/062.o
ORIG_MAPPER_OBJS += mapper/064.o mapper/065.o mapper/066.o mapper/067.o mapper/068.o
ORIG_MAPPER_OBJS += mapper/069.o mapper/070.o mapper/071.o mapper/072.o mapper/073.o
ORIG_MAPPER_OBJS += mapper/074.o mapper/075.o mapper/076.o mapper/077.o mapper/078.o
ORIG_MAPPER_OBJS += mapper/079.o mapper/080.o mapper/082.o mapper/083.o mapper/085.o
ORIG_MAPPER_OBJS += mapper/086.o mapper/087.o mapper/088.o mapper/089.o mapper/090.o
ORIG_MAPPER_OBJS += mapper/091.o mapper/092.o mapper/093.o mapper/094.o mapper/095.o
ORIG_MAPPER_OBJS += mapper/096.o mapper/097.o mapper/099.o mapper/100.o mapper/101.o
ORIG_MAPPER_OBJS += mapper/105.o mapper/112.o mapper/113.o mapper/114.o mapper/115.o
ORIG_MAPPER_OBJS += mapper/117.o mapper/118.o mapper/119.o mapper/122.o mapper/140.o
ORIG_MAPPER_OBJS += mapper/151.o mapper/160.o mapper/180.o mapper/181.o mapper/182.o
ORIG_MAPPER_OBJS += mapper/183.o mapper/185.o mapper/187.o mapper/188.o mapper/189.o
ORIG_MAPPER_OBJS += mapper/222.o mapper/225.o mapper/226.o mapper/227.o mapper/228.o
ORIG_MAPPER_OBJS += mapper/229.o mapper/230.o mapper/231.o mapper/232.o mapper/233.o
ORIG_MAPPER_OBJS += mapper/234.o mapper/235.o mapper/236.o mapper/237.o mapper/240.o
ORIG_MAPPER_OBJS += mapper/241.o mapper/242.o mapper/243.o mapper/244.o mapper/245.o
ORIG_MAPPER_OBJS += mapper/246.o mapper/248.o mapper/249.o mapper/250.o mapper/251.o
ORIG_MAPPER_OBJS += mapper/252.o mapper/254.o mapper/255.o mapper/nsf.o
ORIG_MAPPER_OBJS += mapper/unif001.o mapper/unif002.o mapper/unif003.o mapper/unif004.o
OBJS += $(ORIG_MAPPER_OBJS)
OBJS += dc_gg.o dc_saving.o dc_sound.o dc_sound_mgr.o getmapper.o libsnss.o nes6502.o nes.o nes_6502.o
OBJS += nes_apu.o nes_apu_wrapper.o nes_device_cclimber.o nes_device_gun.o nes_device_hypershot.o nes_device_kbd.o
OBJS += nes_device_mahjong.o nes_device_mic.o nes_device_paddle.o nes_mapper.o nes_pad.o nes_ppu.o nes_rom.o
OBJS += nnnesterj_cheat.o snss.o main.o nesdb.o nesdb_object.o
OBJS += explode.o unreduce.o unshrink.o unzip.o crc32cool.o
# JS Exposure
OBJS += nester_object.o
MY_AFLAGS = -Wa,-little
KOS_CFLAGS += -D__DREAMCAST__ -I. -I../libdreamscript
KOS_CFLAGS += -frename-registers -funswitch-loops -g -O3
all: rm-elf $(TARGET)
include $(KOS_BASE)/Makefile.rules
clean:
$(KOS_MAKE) -C sound clean
-rm -f $(TARGET) $(BIN) $(OBJS) bin/$(TARGET) bin/raw.bin bin/1ST_READ.BIN cd/1ST_READ.BIN
cleanasm:
-rm -f $(ASM_CPU_OBJS)
rm-elf:
-rm -f $(TARGET) $(BIN)
sound-driver:
$(KOS_MAKE) -C sound
$(TARGET): sound-driver $(OBJS)
$(KOS_CC) $(KOS_LDFLAGS) $(KOS_START) $(OBJS) -o $(TARGET) -g -lz -lstdc++ -ldreamscript -lm -lkosutils -limageload -lparallax -ljpeg -lkmg -lpng -lbz2 $(KOS_LIBS)
cp $(TARGET) prestrip_$(TARGET)
$(KOS_STRIP) $(TARGET)
$(KOS_OBJCOPY) -R .stack -O binary $(TARGET) bin/raw.bin
scramble bin/raw.bin bin/1ST_READ.BIN
cp bin/1ST_READ.BIN cd/1ST_READ.BIN
cp $(TARGET) bin/$(TARGET)
nes.o: nes_emulate_frame.cpp nes_set_controller.cpp nes_set_cycles.cpp
nes_ppu.o: render_bg.cpp render_spr.cpp do_scanline.cpp render_tile.cpp
dc_sound.o: sound/aica_fw.h
cdimg:
mkisofs -J -R -l -joliet-long -o cd.iso cd
#include "types.h"
#include "NES_CPU.h"
#include "nes6502.h"
#include "NES.h"
#ifndef _NES_CPU_H_
#define _NES_CPU_H_
#include "types.h"
#include "nes6502.h"
class NES; // prototype of NES class
class NES_CPU
{
//public:
// struct Context : public nes6502_context {};
public:
NES_CPU(){};
virtual ~NES_CPU(){}
// Functions that govern the 6502's execution
virtual void Reset() = 0;
virtual int Execute(int total_cycles) = 0;
virtual void DoNMI(void) = 0;
virtual void DoIRQ(void) = 0;
virtual void DoPendingIRQ(void) = 0;
virtual void SetDMA(int cycles) = 0;
virtual uint8 GetByte(uint32 address) = 0;
virtual uint32 GetCycles() = 0;
protected:
NES* ParentNES;
virtual uint8 MemoryRead(uint32 addr) = 0;
virtual void MemoryWrite(uint32 addr, uint8 data) = 0;
// friend void NES_write(uint32 address, uint8 value);
// friend uint8 NES_read(uint32 address);
};
#endif
#include "app.h"
#include "MyDlg.h"
#include <wx/filesys.h>
#include <wx/fs_inet.h>
#include <wx/socket.h>
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
VwXinitApp();
wxSocketBase::Initialize();
wxFileSystem::AddHandler(new wxInternetFSHandler);
dlg = new MyDlg(NULL,-1,"");
dlg->ShowModal();
return FALSE;
}
int MyApp::OnExit()
{
if (dlg->pBuildThread && dlg->pBuildThread->IsRunning())
{
dlg->buttonStart->SetLabel("Stopping Build");
dlg->buttonStart->Enable(false);
dlg->pBuildThread->Delete();
}
return wxApp::OnExit();
}
#ifndef __MyApp_H__
#define __MyApp_H__
#include <wx/app.h>
class MyDlg;
class MyApp : public wxApp
{
public:
bool VwXinitApp();
virtual bool OnInit();
virtual int OnExit();
MyDlg *dlg;
};
DECLARE_APP(MyApp)
#endif
// Don't modify comment
#include "MyDlg.h"
//[inc]add your include files here
#include <wx/dirdlg.h>
#include <wx/filename.h>
#include <wx/thread.h>
#include "XML.h"
#include "xml_serialize.h"
#include <wx/process.h>
//[inc]end your include
IMPLEMENT_CLASS(MyDlg,wxDialog)
MyDlg::MyDlg(){
}
MyDlg::MyDlg(wxWindow* parent,wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style,const wxString& name)
VwX_INIT_OBJECTS_MyDlg
{
OnPreCreate();
Create(parent,id,title,pos,size,style,name);
if((pos==wxDefaultPosition)&&(size==wxDefaultSize)){
SetSize(0,0,564,480);
}
if((pos!=wxDefaultPosition)&&(size==wxDefaultSize)){
SetSize(564,480);
}
initBefore();
fileImgBuf[0].LoadFile(_T("images/nesterdcselogo05.gif"),wxBITMAP_TYPE_GIF);
bitmapTitleImg0=&fileImgBuf[0];
VwXinit();initAfter();
}
MyDlg::~MyDlg()
{
txtMasterLibrary->PopEventHandler(true);
txtROMs->PopEventHandler(true);
DMyDlg();
}
void MyDlg::VwXinit()
{
SetTitle(wxT("NesterDC SE CD Builder"));
bitmapTitle=new wxStaticBitmap(this,-1,*bitmapTitleImg0,wxPoint(6,7),wxSize(543,125));
st4c=new wxStaticText(this,-1,wxT(""),wxPoint(30,146),wxSize(141,16),wxST_NO_AUTORESIZE);
st4c->SetLabel(wxT("ROMs Path:"));
st4c->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
st5c=new wxStaticText(this,-1,wxT(""),wxPoint(31,172),wxSize(141,21),wxST_NO_AUTORESIZE);
st5c->SetLabel(wxT("Master Library URL:"));
st5c->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
st6c=new wxStaticText(this,-1,wxT(""),wxPoint(30,198),wxSize(141,21),wxST_NO_AUTORESIZE);
st6c->SetLabel(wxT("CD Image Format:"));
st6c->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
st7c=new wxStaticText(this,-1,wxT(""),wxPoint(32,224),wxSize(141,21),wxST_NO_AUTORESIZE);
st7c->SetLabel(wxT("Features:"));
st7c->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
txtROMs=new wxTextCtrl(this,-1,wxT(""),wxPoint(181,146),wxSize(300,21),wxTE_PROCESS_ENTER);
txtROMs->PushEventHandler(new MyDlgEvt(this));
txtMasterLibrary=new wxTextCtrl(this,-1,wxT(""),wxPoint(181,172),wxSize(300,21),wxTE_PROCESS_ENTER);
txtMasterLibrary->SetLabel(wxT("http://www.sch3rz0.com/nesterdcse/master_library"));
txtMasterLibrary->PushEventHandler(new MyDlgEvt(this));
chkCartridge=new wxCheckBox(this,-1,wxT(""),wxPoint(181,224),wxSize(141,21));
chkCartridge->SetValue(true);
chkCartridge->SetTitle(wxT("Cartridge Scans"));
chkCartridge->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
chkInstructions=new wxCheckBox(this,-1,wxT(""),wxPoint(327,224),wxSize(166,21));
chkInstructions->SetValue(true);
chkInstructions->SetTitle(wxT("Instruction Manuals"));
chkInstructions->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
chkFAQs=new wxCheckBox(this,-1,wxT(""),wxPoint(181,246),wxSize(141,21));
chkFAQs->SetValue(true);
chkFAQs->SetTitle(wxT("FAQs"));
chkFAQs->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
chkTitles=new wxCheckBox(this,-1,wxT(""),wxPoint(327,246),wxSize(141,21));
chkTitles->SetValue(true);
chkTitles->SetTitle(wxT("Title Shots"));
chkTitles->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
chkScreens=new wxCheckBox(this,-1,wxT(""),wxPoint(327,268),wxSize(191,21));
chkScreens->SetValue(true);
chkScreens->SetTitle(wxT("Screen Shots (in-game)"));
chkScreens->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
chkBoxes=new wxCheckBox(this,-1,wxT(""),wxPoint(181,268),wxSize(141,21));
chkBoxes->SetValue(true);
chkBoxes->SetTitle(wxT("Box Scans"));
chkBoxes->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
chkNSFs=new wxCheckBox(this,-1,wxT(""),wxPoint(181,290),wxSize(141,21));
chkNSFs->SetValue(true);
chkNSFs->SetTitle(wxT("NSFs"));
chkNSFs->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
chkGameGenie=new wxCheckBox(this,-1,wxT(""),wxPoint(327,290),wxSize(189,21));
chkGameGenie->SetValue(true);
chkGameGenie->SetTitle(wxT("Game Genie Codes"));
chkGameGenie->SetFont(wxFont(12,74,90,90,0,wxT("Tahoma")));
wxString dropImageFormatItem[]={wxT("Nero"),wxT("DiscJuggler")};
dropImageFormat=new wxChoice(this,-1,wxPoint(181,198),wxSize(300,21),2,dropImageFormatItem);
txtOutput=new wxTextCtrl(this,-1,wxT(""),wxPoint(3,316),wxSize(552,130),wxTE_MULTILINE);
buttonStart=new wxButton(this,-1,wxT(""),wxPoint(18,254),wxSize(147,54));
buttonStart->SetLabel(wxT("Start Build"));
buttonStart->SetFont(wxFont(14,74,90,90,0,wxT("Tahoma")));
buttonROMs=new wxButton(this,-1,wxT(""),wxPoint(485,146),wxSize(20,21));
buttonROMs->SetLabel(wxT("..."));
chkLibraryDefault=new wxCheckBox(this,-1,wxT(""),wxPoint(483,172),wxSize(73,21));
chkLibraryDefault->SetTitle(wxT("Default"));
Refresh();
}
BEGIN_EVENT_TABLE(MyDlgEvt,wxEvtHandler)
EVT_KILL_FOCUS(MyDlgEvt::VwXEvOnKillFocus)
//[evtEvt]add your code here
//[evtEvt]end your code
END_EVENT_TABLE()
void MyDlgEvt::VwXEvOnKillFocus(wxFocusEvent& event){
ptr_winPan->VwXVwXEvOnKillFocus(event);
}
BEGIN_EVENT_TABLE( MyDlg,wxDialog)
EVT_BUTTON(-1,MyDlg::VwXVwXEvOnButtonClick)
EVT_CHECKBOX(-1,MyDlg::VwXVwXEvOnCheckBox)
EVT_CHOICE(-1,MyDlg::VwXVwXEvOnChoiceSelect)
EVT_ERASE_BACKGROUND(MyDlg::VwXVwXEvOnEraseBackground)
EVT_INIT_DIALOG(MyDlg::VwXVwXEvOnInitDialog)
EVT_KILL_FOCUS(MyDlg::VwXVwXEvOnKillFocus)
EVT_TEXT_ENTER(-1,MyDlg::VwXVwXEvOnTextEnter)
//[evtwin]add your code here
//[evtwin]end your code
END_EVENT_TABLE()
void MyDlg::VwXVwXEvOnTextEnter(wxCommandEvent& event){
wxObject *m_wxWin = event.m_eventObject ;
if(m_wxWin==txtROMs){txtROMs_VwXEvOnTextEnter(event,-1);return;}
if(m_wxWin==txtMasterLibrary){txtMasterLibrary_VwXEvOnTextEnter(event,-1);return;}
event.Skip(true);
}
void MyDlg::VwXVwXEvOnKillFocus(wxFocusEvent& event){
wxObject *m_wxWin = event.m_eventObject ;
if(m_wxWin==txtROMs){event.Skip(true);txtROMs_VwXEvOnKillFocus(event,-1);return;}
if(m_wxWin==txtMasterLibrary){event.Skip(true);txtMasterLibrary_VwXEvOnKillFocus(event,-1);return;}
event.Skip(true);
}
void MyDlg::VwXVwXEvOnInitDialog(wxInitDialogEvent& event){
wxObject *m_wxWin = event.m_eventObject ;
if(m_wxWin==this){event.Skip(true);VwXEvOnInitDialog(event) ;return;}
event.Skip(true);
}
void MyDlg::VwXVwXEvOnEraseBackground(wxEraseEvent& event){
wxObject *m_wxWin = event.m_eventObject ;
if(m_wxWin==this){event.Skip(true);VwXEvOnEraseBackground(event) ;return;}
event.Skip(true);
}
void MyDlg::VwXVwXEvOnChoiceSelect(wxCommandEvent& event){
wxObject *m_wxWin = event.m_eventObject ;
if(m_wxWin==dropImageFormat){dropImageFormat_VwXEvOnChoiceSelect(event,-1);return;}
event.Skip(true);
}
void MyDlg::VwXVwXEvOnCheckBox(wxCommandEvent& event){
wxObject *m_wxWin = event.m_eventObject ;
if(m_wxWin==chkFAQs){chkFAQs_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkTitles){chkTitles_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkScreens){chkScreens_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkBoxes){chkBoxes_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkNSFs){chkNSFs_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkGameGenie){chkGameGenie_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkInstructions){chkInstructions_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkCartridge){chkCartridge_VwXEvOnCheckBox(event,-1);return;}
if(m_wxWin==chkLibraryDefault){chkLibraryDefault_VwXEvOnCheckBox(event,-1);return;}
event.Skip(true);
}
void MyDlg::VwXVwXEvOnButtonClick(wxCommandEvent& event){
wxObject *m_wxWin = event.m_eventObject ;
if(m_wxWin==buttonROMs){buttonROMs_VwXEvOnButtonClick(event,-1);return;}
if(m_wxWin==buttonStart){buttonStart_VwXEvOnButtonClick(event,-1);return;}
event.Skip(true);
}
//[evtFunc]add your code here
void MyDlg::txtROMs_VwXEvOnKillFocus(wxFocusEvent& event,int index){ //init function
//[5fb]Code event VwX...Don't modify[5fb]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::txtMasterLibrary_VwXEvOnKillFocus(wxFocusEvent& event,int index){ //init function
//[5fd]Code event VwX...Don't modify[5fd]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::txtROMs_VwXEvOnTextEnter(wxCommandEvent& event,int index){ //init function
//[194]Code event VwX...Don't modify[194]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::txtMasterLibrary_VwXEvOnTextEnter(wxCommandEvent& event,int index){ //init function
//[195]Code event VwX...Don't modify[195]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::EnableConfigControls(bool b)
{
txtROMs->Enable(b);
txtMasterLibrary->Enable(b);
chkCartridge->Enable(b);
chkInstructions->Enable(b);
chkFAQs->Enable(b);
chkTitles->Enable(b);
chkScreens->Enable(b);
chkBoxes->Enable(b);
chkNSFs->Enable(b);
chkGameGenie->Enable(b);
dropImageFormat->Enable(b);
buttonROMs->Enable(b);
chkLibraryDefault->Enable(b);
}
void MyDlg::OnBuildComplete()
{
buttonStart->Enable(true);
buttonStart->SetLabel("Start Build");
EnableConfigControls(true);
}
void MyDlg::buttonStart_VwXEvOnButtonClick(wxCommandEvent& event,int index){ //init function
//[2e8]Code event VwX...Don't modify[2e8]//
//add your code here
if (pBuildThread)
{
if (pBuildThread->IsRunning())
{
buttonStart->SetLabel("Stopping Build");
buttonStart->Enable(false);
pBuildThread->Delete();
OnBuildComplete();
txtOutput->AppendText("BUILD PROCESS ABORTED BY USER!\n\n");
return;
}
delete pBuildThread;
}
txtOutput->SetValue("");
EnableConfigControls(false);
pBuildThread = new CDBuildThread("buildcfg.xml", txtOutput, this);
pBuildThread->Create();
pBuildThread->Run();
buttonStart->SetLabel("Stop Build");
} //end function
void MyDlg::chkTitles_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[18e]Code event VwX...Don't modify[18e]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::chkScreens_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[18f]Code event VwX...Don't modify[18f]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::chkNSFs_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[191]Code event VwX...Don't modify[191]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::chkInstructions_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[18c]Code event VwX...Don't modify[18c]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::chkGameGenie_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[192]Code event VwX...Don't modify[192]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::chkFAQs_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[18d]Code event VwX...Don't modify[18d]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::chkCartridge_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[18b]Code event VwX...Don't modify[18b]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::chkBoxes_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[190]Code event VwX...Don't modify[190]//
//add your code here
UpdateCFG();
} //end function
void MyDlg::dropImageFormat_VwXEvOnChoiceSelect(wxCommandEvent& event,int index){ //init function
//[2ac]Code event VwX...Don't modify[2ac]//
//add your code here
UpdateCFG();
} //end function
wxString defaultLibraryURL = "http://www.sch3rz0.com/nesterdcse/master_library";
void MyDlg::chkLibraryDefault_VwXEvOnCheckBox(wxCommandEvent& event,int index){ //init function
//[53c]Code event VwX...Don't modify[53c]//
//add your code here
if (chkLibraryDefault->IsChecked())
{
txtMasterLibrary->SetValue(defaultLibraryURL);
txtMasterLibrary->SetEditable(false);
}
else
{
txtMasterLibrary->SetValue("");
txtMasterLibrary->SetEditable(true);
}
UpdateCFG();
} //end function
void MyDlg::buttonROMs_VwXEvOnButtonClick(wxCommandEvent& event,int index){ //init function
//[ a8]Code event VwX...Don't modify[ a8]//
//add your code here
wxDirDialog dlg(this);
dlg.SetPath(txtROMs->GetValue());
if (dlg.ShowModal() == wxID_OK)
{
txtROMs->SetValue(wxFileName(dlg.GetPath()).GetFullPath());
UpdateCFG();
}
} //end function
void MyDlg::VwXEvOnInitDialog(wxInitDialogEvent& event){ //init function
//[7aa]Code event VwX...Don't modify[7aa]//
//add your code here
} //end function
void MyDlg::VwXEvOnEraseBackground(wxEraseEvent& event){ //init function
//[6eb]Code event VwX...Don't modify[6eb]//
//add your code here
} //end function
void MyDlg::initBefore(){
//add your code here
pBuildThread = NULL;
}
void MyDlg::initAfter(){
//add your code here
ReadCFG();
dropImageFormat->SetSelection(0);
Centre();
}
void MyDlg::OnPreCreate(){
//add your code here
}
void MyDlg::DMyDlg(){
//add your code here
}
static volatile bool inUpdateCFG = false;
void MyDlg::UpdateCFG()
{
if (inUpdateCFG)
return;
inUpdateCFG = true;
XML* root = XML_OpenFile("buildcfg.xml");
if (!root)
return;
XML_SetAttribute(root, "roms_path", txtROMs->GetValue());
XML_SetAttribute(root, "library_url", txtMasterLibrary->GetValue());
char sztemp[0x10];
sprintf(sztemp, "%d", dropImageFormat->GetSelection());
XML_SetAttribute(root, "image_format", sztemp);
//Features
XML_SetAttribute(root, "get_carts", chkCartridge->IsChecked()?"true":"false");
XML_SetAttribute(root, "get_manuals", chkInstructions->IsChecked()?"true":"false");
XML_SetAttribute(root, "get_faqs", chkFAQs->IsChecked()?"true":"false");
XML_SetAttribute(root, "get_titles", chkTitles->IsChecked()?"true":"false");
XML_SetAttribute(root, "get_screenshots", chkScreens->IsChecked()?"true":"false");
XML_SetAttribute(root, "get_boxes", chkBoxes->IsChecked()?"true":"false");
XML_SetAttribute(root, "get_nsfs", chkNSFs->IsChecked()?"true":"false");
XML_SetAttribute(root, "get_gamegenie", chkGameGenie->IsChecked()?"true":"false");
wxString strdoc = XML_Serialize(root);
//wxMessageDialog dlg(this, strdoc); dlg.ShowModal();
FILE* fp = fopen("buildcfg.xml", "wb");
if (fp)
{
fprintf(fp, strdoc.c_str());
fclose(fp);
}
XML_Destroy(root);
inUpdateCFG = false;
}
void MyDlg::ReadCFG()
{
XML* root = XML_OpenFile("buildcfg.xml");
if (!root)
return;
const char* sztemp;
if (sztemp = XML_GetAttribute(root, "roms_path"))
txtROMs->SetValue(sztemp);
//defaultLibraryURL
if (sztemp = XML_GetAttribute(root, "library_url"))
{
txtMasterLibrary->SetValue(sztemp);
chkLibraryDefault->SetValue(defaultLibraryURL == sztemp);
txtMasterLibrary->SetEditable(defaultLibraryURL != sztemp);
}
if (sztemp = XML_GetAttribute(root, "image_format"))
{
unsigned long val;
if (wxString(sztemp).ToULong(&val))
dropImageFormat->SetSelection(val);
}
if (sztemp = XML_GetAttribute(root, "get_carts"))
chkCartridge->SetValue((wxString(sztemp)=="true")?true:false);
if (sztemp = XML_GetAttribute(root, "get_manuals"))
chkInstructions->SetValue((wxString(sztemp)=="true")?true:false);
if (sztemp = XML_GetAttribute(root, "get_faqs"))
chkFAQs->SetValue((wxString(sztemp)=="true")?true:false);
if (sztemp = XML_GetAttribute(root, "get_titles"))
chkTitles->SetValue((wxString(sztemp)=="true")?true:false);
if (sztemp = XML_GetAttribute(root, "get_screenshots"))
chkScreens->SetValue((wxString(sztemp)=="true")?true:false);
if (sztemp = XML_GetAttribute(root, "get_boxes"))
chkBoxes->SetValue((wxString(sztemp)=="true")?true:false);
if (sztemp = XML_GetAttribute(root, "get_nsfs"))
chkNSFs->SetValue((wxString(sztemp)=="true")?true:false);
if (sztemp = XML_GetAttribute(root, "get_gamegenie"))
chkGameGenie->SetValue((wxString(sztemp)=="true")?true:false);
XML_Destroy(root);
}
//[evtFunc]end your code
// Don't modify comment
#ifndef __VwX_MyDlg_H__
#define __VwX_MyDlg_H__
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
//[inc]add your include files here
#include "cdbuildthread.h"
//[inc]end your include
class MyDlg;
class MyDlgEvt:public wxEvtHandler
{
public:
MyDlgEvt(MyDlg *parent){ptr_winPan=parent;}
protected:
MyDlg *ptr_winPan;
DECLARE_EVENT_TABLE()
void VwXEvOnKillFocus(wxFocusEvent& event);
//[evt]add your code here
//[evt]end your code
};
class MyDlg:public wxDialog
{
DECLARE_CLASS(MyDlg)
friend class MyDlgEvt;
public:
MyDlg();
MyDlg(wxWindow* parent, wxWindowID id = -1, const wxString& title = wxT(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|wxDIALOG_NO_PARENT|wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX, const wxString& name = wxT("dialogBox"));
// Pointer control
wxStaticBitmap *bitmapTitle;
wxStaticText *st4c;
wxStaticText *st5c;
wxStaticText *st6c;
wxStaticText *st7c;
wxTextCtrl *txtROMs;
wxTextCtrl *txtMasterLibrary;
wxCheckBox *chkCartridge;
wxCheckBox *chkInstructions;
wxCheckBox *chkFAQs;
wxCheckBox *chkTitles;
wxCheckBox *chkScreens;
wxCheckBox *chkBoxes;
wxCheckBox *chkNSFs;
wxCheckBox *chkGameGenie;
wxChoice *dropImageFormat;
wxTextCtrl *txtOutput;
wxButton *buttonStart;
wxButton *buttonROMs;
wxCheckBox *chkLibraryDefault;
virtual ~MyDlg();
void DMyDlg();
void initBefore();
void OnPreCreate();
void VwXinit();
wxBitmap *bitmapTitleImg0;
wxBitmap fileImgBuf[1];
void initAfter();
protected:
void VwXVwXEvOnButtonClick(wxCommandEvent& event);
void VwXVwXEvOnCheckBox(wxCommandEvent& event);
void VwXVwXEvOnChoiceSelect(wxCommandEvent& event);
void VwXVwXEvOnEraseBackground(wxEraseEvent& event);
void VwXVwXEvOnInitDialog(wxInitDialogEvent& event);
void VwXVwXEvOnKillFocus(wxFocusEvent& event);
void VwXVwXEvOnTextEnter(wxCommandEvent& event);
void VwXEvOnInitDialog(wxInitDialogEvent& event);
void VwXEvOnEraseBackground(wxEraseEvent& event);
void txtROMs_VwXEvOnTextEnter(wxCommandEvent& event,int index=-1);
void txtROMs_VwXEvOnKillFocus(wxFocusEvent& event,int index=-1);
void txtMasterLibrary_VwXEvOnTextEnter(wxCommandEvent& event,int index=-1);
void txtMasterLibrary_VwXEvOnKillFocus(wxFocusEvent& event,int index=-1);
void dropImageFormat_VwXEvOnChoiceSelect(wxCommandEvent& event,int index=-1);
void chkTitles_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkScreens_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkNSFs_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkLibraryDefault_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkInstructions_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkGameGenie_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkFAQs_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkCartridge_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void chkBoxes_VwXEvOnCheckBox(wxCommandEvent& event,int index=-1);
void buttonStart_VwXEvOnButtonClick(wxCommandEvent& event,int index=-1);
void buttonROMs_VwXEvOnButtonClick(wxCommandEvent& event,int index=-1);
DECLARE_EVENT_TABLE()
//[win]add your code here
public:
void EnableConfigControls(bool b);
CDBuildThread* pBuildThread;
void UpdateCFG();
void ReadCFG();
void OnBuildComplete();
#define VwX_INIT_OBJECTS_MyDlg
//[win]end your code
};
// end MyDlg
#endif
[InitFile]
init=134324
[Project]
VisualWxVersion=0.86.0.0
VisualWxIdent=8600
Nome=NesterDCSEBuilderWx.pbc
ProjectCreate=1
ProjectBuild=0
CountConfComp=2
nomifileEsi=
idmax=23
idmaxFile=100064
idIncCmp=1054
l_progTipo=0
l_compTipo=0
l_framTipo=0
imageAllH=1
numFile=20
[Project/conf0]
name=Release
ws_dirobj=
ws_direxe=
ws_exeName=NesterDCSEBuilderWx
debugVers=0
paramRun=
ws_paramRunPython=python.exe app.py
ws_paramRunPerl=perl.exe app.pl
ws_paramRunLua=wxlua.exe app.lua
ws_paramRunComp=testCmp\\test.exe
ws_paramRunRuby=ruby.exe app.rbw
ws_paramCompCPP=%Default-Compiler-Options0%
ws_paramCompLinker=%Default-Link-Options0% -lwx_base_net-2.6 -lwsock32 -s
ws_MakeComp=
enableMake=0
sA_libDirIND=1
sA_libDir0=%wxWidgets-Lib-Dir%
sA_incCPPDirIND=1
sA_incCPPDir0=%wxWidgets-Inc-Dir%
sA_incCDirIND=0
sA_resDirIND=1
sA_resDir0=%wxWidgets-Res-Dir%
[Project/conf1]
name=Debug
ws_dirobj=debug\\
ws_direxe=
ws_exeName=Project
debugVers=1
paramRun=
ws_paramRunPython=python.exe app.py
ws_paramRunPerl=perl.exe app.pl
ws_paramRunLua=wxlua.exe app.lua
ws_paramRunComp=testCmp\\test.exe
ws_paramRunRuby=ruby.exe app.rbw
ws_paramCompCPP=%Default-Compiler-Options0D%
ws_paramCompLinker=%Default-Link-Options0D%
ws_MakeComp=
enableMake=0
sA_libDirIND=1
sA_libDir0=%wxWidgets-debug-Lib-Dir%
sA_incCPPDirIND=1
sA_incCPPDir0=%wxWidgets-debug-Inc-Dir%
sA_incCDirIND=0
sA_resDirIND=1
sA_resDir0=%wxWidgets-debug-Res-Dir%
[Project/resource]
numRes=2
ResScriptAdd=
incResName=1
xptheme=0
[Project/resource/0]
name=wx Resource
filetipo=Include Files
tipo=12
filename=wx/msw/wx.rc
[Project/resource/1]
name=ICONPRG
filetipo=Icon files
tipo=1
filename=images/nes.ico
[Project/imageH]
0=0
1=0
2=0
3=0
4=0
5=0
6=0
7=0
8=0
9=0
10=0
11=0
12=0
13=0
14=0
15=0
16=0
17=0
18=0
19=0
[Project/comVirt]
iN=0
[Project/GroupsName]
count=1
item0name=Save Project
item0id=1053
[File0]
ws_name=Design
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=2
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1001
[File1]
ws_name=MyDlg.pfr
ws_dir=.\\
s_tipoFile=15
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=100064
i_FileIdentPar=2
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=20
idIncCmpFilCmp=1002
[File2]
ws_name=Source File
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=3
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1003
[File3]
ws_name=App.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100030
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1004
[File4]
ws_name=App.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100032
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1005
[File5]
ws_name=VwXApp.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100014
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=0
l_ReadOnly=1
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1006
[File6]
ws_name=XML.c
ws_dir=.\\
s_tipoFile=0
s_tipoComp=1
ClsparentCompTipo=0
i_FileIdent=100041
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1033
[File7]
ws_name=XML.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100042
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1034
[File8]
ws_name=punk_array.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100043
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1035
[File9]
ws_name=main_stuff.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100046
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1038
[File10]
ws_name=nesdb.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100048
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1040
[File11]
ws_name=crc32cool.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100050
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1042
[File12]
ws_name=crc32cool.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100052
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1044
[File13]
ws_name=main_stuff.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100053
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1045
[File14]
ws_name=nesdb.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100054
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1046
[File15]
ws_name=xml_serialize.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100057
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
i_numLine=9
idIncCmpFilCmp=1049
[File16]
ws_name=xml_serialize.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100058
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1050
[File17]
ws_name=cdbuildthread.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100061
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1053
[File18]
ws_name=cdbuildthread.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100062
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1054
[File19]
ws_name=Resource File
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=4
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1007
[File20]
ws_name=File
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=5
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1009
[TemplateComp]
count=0
[EndFile]
end=134324
[InitFile]
init=134324
[Project]
VisualWxVersion=0.86.0.0
VisualWxIdent=8600
Nome=NesterDCSEBuilderWx.pbc
ProjectCreate=1
ProjectBuild=0
CountConfComp=2
nomifileEsi=
idmax=23
idmaxFile=100064
idIncCmp=1054
l_progTipo=0
l_compTipo=0
l_framTipo=0
imageAllH=1
numFile=20
[Project/conf0]
name=Release
ws_dirobj=
ws_direxe=
ws_exeName=NesterDCSEBuilderWx
debugVers=0
paramRun=
ws_paramRunPython=python.exe app.py
ws_paramRunPerl=perl.exe app.pl
ws_paramRunLua=wxlua.exe app.lua
ws_paramRunComp=testCmp\\test.exe
ws_paramRunRuby=ruby.exe app.rbw
ws_paramCompCPP=%Default-Compiler-Options0%
ws_paramCompLinker=%Default-Link-Options0% -lwx_base_net-2.6 -lwsock32 -s
ws_MakeComp=
enableMake=0
sA_libDirIND=1
sA_libDir0=%wxWidgets-Lib-Dir%
sA_incCPPDirIND=1
sA_incCPPDir0=%wxWidgets-Inc-Dir%
sA_incCDirIND=0
sA_resDirIND=1
sA_resDir0=%wxWidgets-Res-Dir%
[Project/conf1]
name=Debug
ws_dirobj=debug\\
ws_direxe=
ws_exeName=Project
debugVers=1
paramRun=
ws_paramRunPython=python.exe app.py
ws_paramRunPerl=perl.exe app.pl
ws_paramRunLua=wxlua.exe app.lua
ws_paramRunComp=testCmp\\test.exe
ws_paramRunRuby=ruby.exe app.rbw
ws_paramCompCPP=%Default-Compiler-Options0D%
ws_paramCompLinker=%Default-Link-Options0D%
ws_MakeComp=
enableMake=0
sA_libDirIND=1
sA_libDir0=%wxWidgets-debug-Lib-Dir%
sA_incCPPDirIND=1
sA_incCPPDir0=%wxWidgets-debug-Inc-Dir%
sA_incCDirIND=0
sA_resDirIND=1
sA_resDir0=%wxWidgets-debug-Res-Dir%
[Project/resource]
numRes=2
ResScriptAdd=
incResName=1
xptheme=0
[Project/resource/0]
name=wx Resource
filetipo=Include Files
tipo=12
filename=wx/msw/wx.rc
[Project/resource/1]
name=ICONPRG
filetipo=Icon files
tipo=1
filename=images/nes.ico
[Project/imageH]
0=0
1=0
2=0
3=0
4=0
5=0
6=0
7=0
8=0
9=0
10=0
11=0
12=0
13=0
14=0
15=0
16=0
17=0
18=0
19=0
[Project/comVirt]
iN=0
[Project/GroupsName]
count=1
item0name=Save Project
item0id=1053
[File0]
ws_name=Design
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=2
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1001
[File1]
ws_name=MyDlg.pfr
ws_dir=.\\
s_tipoFile=15
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=100064
i_FileIdentPar=2
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=20
idIncCmpFilCmp=1002
[File2]
ws_name=Source File
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=3
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1003
[File3]
ws_name=App.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100030
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1004
[File4]
ws_name=App.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100032
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1005
[File5]
ws_name=VwXApp.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100014
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=0
l_ReadOnly=1
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1006
[File6]
ws_name=XML.c
ws_dir=.\\
s_tipoFile=0
s_tipoComp=1
ClsparentCompTipo=0
i_FileIdent=100041
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1033
[File7]
ws_name=XML.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100042
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1034
[File8]
ws_name=punk_array.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100043
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1035
[File9]
ws_name=main_stuff.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100046
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1038
[File10]
ws_name=nesdb.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100048
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1040
[File11]
ws_name=crc32cool.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100050
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1042
[File12]
ws_name=crc32cool.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100052
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1044
[File13]
ws_name=main_stuff.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100053
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1045
[File14]
ws_name=nesdb.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100054
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1046
[File15]
ws_name=xml_serialize.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100057
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
i_numLine=9
idIncCmpFilCmp=1049
[File16]
ws_name=xml_serialize.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100058
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1050
[File17]
ws_name=cdbuildthread.cpp
ws_dir=.\\
s_tipoFile=0
s_tipoComp=2
ClsparentCompTipo=0
i_FileIdent=100061
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1053
[File18]
ws_name=cdbuildthread.h
ws_dir=.\\
s_tipoFile=0
s_tipoComp=-1
ClsparentCompTipo=0
i_FileIdent=100062
i_FileIdentPar=3
wx_WindowFileADD=0
l_ProtettoDesigne=1
l_ReadOnly=0
l_compilare=1
l_syncCompil=
l_linkare=1
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=6
idIncCmpFilCmp=1054
[File19]
ws_name=Resource File
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=4
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1007
[File20]
ws_name=File
ws_dir=
s_tipoFile=-1000
s_tipoComp=0
ClsparentCompTipo=0
i_FileIdent=5
i_FileIdentPar=1
wx_WindowFileADD=-1163005939
l_ProtettoDesigne=0
l_ReadOnly=0
l_compilare=0
l_syncCompil=
l_linkare=0
l_tipoCompilatore=0
l_RigeneraSempre=0
i_numImag=33
idIncCmpFilCmp=1009
[TemplateComp]
count=0
[EndFile]
end=134324
#include "app.h"
#include <wx/image.h>
bool MyApp::VwXinitApp()
{
wxInitAllImageHandlers();
return true;
}
#include "XML.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
uint32 XML_resize_count = 0x10;
void XML_Init(XML* p, const char* szName)
{
if (szName)
{
uint32 len = strlen(szName);
p->name = (char*) malloc(len + 1);
memcpy(p->name, szName, len);
p->name[len] = '\0';
}
else
p->name = NULL;
p->text = NULL;
p->parent = NULL;
p->parent_delete = 1;
punk_array_init(p->children);
punk_array_init(p->attribute_names);
punk_array_init(p->attribute_values);
}
void XML_Destroy(XML* p)
{
if (p->name)
free(p->name);
if (p->text)
free(p->text);
uint32 k = 0;
for (; k < p->attribute_names.count; ++k)
free(p->attribute_names.data[k]);
for (k = 0; k < p->attribute_values.count; ++k)
free(p->attribute_values.data[k]);
for (k = 0; k < p->children.count; ++k)
{
if (p->children.data[k]->parent_delete)
free(p->children.data[k]);
}
}
void XML_SetText(XML* p, const char* szText)
{
if (p->text)
free(p->text);
p->text = (char*) malloc(strlen(szText)+1);
strcpy(p->text, szText);
}
void XML_AppendText(XML* p, const char* szText)
{
if (!p->text)
XML_SetText(p, szText);
else
{
char* sztemp = (char*) malloc(strlen(p->text)+strlen(szText)+1);
sprintf(sztemp, "%s%s", p->text, szText);
free(p->text);
p->text = sztemp;
}
}
void XML_AddChildNode(XML* p, XML* node)
{
node->parent_delete = 0;
punk_array_push(p->children, node);
node->parent = p;
}
XML* XML_AddChild(XML* p, const char* szName)
{
XML* temp = (XML*) malloc(sizeof(XML));
XML_Init(temp, szName);
XML_AddChildNode(p, temp);
return temp;
}
void XML_SetAttribute(XML* p, const char* name, const char* value)
{
uint32 k;
for (k = 0; k < p->attribute_names.count; ++k)
{
if (strcmp(p->attribute_names.data[k], name) == 0)
{
free(p->attribute_values.data[k]);
int32 len = strlen(value);
char* temp = (char*) malloc(len + 1);
memcpy(temp, value, len);
temp[len] = '\0';
p->attribute_values.data[k] = temp;
return;
}
}
int32 len = strlen(name);
char* temp = (char*) malloc(len + 1);
memcpy(temp, name, len);
temp[len] = '\0';
punk_array_push(p->attribute_names, temp);
len = strlen(value);
temp = (char*) malloc(len + 1);
memcpy(temp, value, len);
temp[len] = '\0';
punk_array_push(p->attribute_values, temp);
}
const char* XML_GetAttribute(XML* p, const char* name)
{
uint32 k;
for (k = 0; k < p->attribute_names.count; ++k)
{
if (stricmp(p->attribute_names.data[k], name) == 0)
return p->attribute_values.data[k];
}
return NULL;
}
const char* XML_GetAttributeString(XML* p, const char* name, const char* szDefault)
{
uint32 k;
for (k = 0; k < p->attribute_names.count; ++k)
{
if (stricmp(p->attribute_names.data[k], name) == 0)
return p->attribute_values.data[k];
}
return szDefault;
}
int32 XML_GetAttributeInt(XML* p, const char* name, int32 iDefault)
{
const char* sztemp = XML_GetAttribute(p, name);
if (!sztemp)
return iDefault;
return atoi(sztemp);
}
uint32 XML_GetAttributeHex(XML* p, const char* name, uint32 uiDefault)
{
const char* sztemp = XML_GetAttribute(p, name);
if (!sztemp)
return uiDefault;
hexstr_to_uint32(sztemp, &uiDefault);
return uiDefault;
}
XML* XML_Find(XML* p, const char* tagname, const char* attr_name, const char* attr_val)
{
XML* temp = NULL;
uint32 k;
for (k = 0; k < p->children.count; ++k)
{
temp = p->children.data[k];
if (stricmp(temp->name, tagname) == 0)
{
if (attr_name)
{
uint32 n;
for (n = 0; n < temp->attribute_names.count; ++n)
{
if (stricmp(temp->attribute_names.data[n], attr_name) == 0)
{
if (!attr_val || stricmp(temp->attribute_values.data[n], attr_val) == 0)
return temp;
}
}
}
else
return temp;
}
if ((temp = XML_Find(temp, tagname, attr_name, attr_val)))
return temp;
}
return NULL;
}
#define MODE_SCANNING 0
#define MODE_TAG 1
#define MODE_TEXT 2
char *ne_shave(char *str, const char *whitespace)
{
char *pnt, *ret = str;
while (*ret != '\0' && strchr(whitespace, *ret) != NULL) {
ret++;
}
/* pnt points at the NUL terminator. */
pnt = &ret[strlen(ret)];
while (pnt > ret && strchr(whitespace, *(pnt-1)) != NULL) {
pnt--;
}
*pnt = '\0';
return ret;
}
XML* XML_Parse(const char* szDoc)
{
XML* root = NULL;
XML* curnode = NULL;
int32 mode = MODE_SCANNING;
uint32 doclen = strlen(szDoc);
char* doc = (char*) malloc(doclen + 1);
memcpy(doc, szDoc, doclen);
doc[doclen] = '\0';
char* curTextBegin = NULL;
char* pos = doc;
char* end = doc + doclen;
while (pos < end)
{
//printf("pos = %d char = %c mode = %d\n", pos-doc, *pos, mode);
if (mode == MODE_SCANNING || mode == MODE_TEXT)
{
if (*pos == '<')
{
if (pos[1] == '/')
{
if (!curnode)
goto parse_failed;
// Make Text
if (mode == MODE_TEXT && curTextBegin && curnode)
{
*pos = '\0';
XML_AppendText(curnode, ne_shave(curTextBegin, " \t\r\n"));
}
pos += 2;
char* base = pos;
while (*pos != '>')
{
++pos;
if (pos == end)
goto parse_failed;
}
*pos = '\0';
//printf("end tag name = %s curnode = %s\n", base, curnode->name);
if (strcmp(base, curnode->name) != 0)
goto parse_failed;
curnode = curnode->parent;
curTextBegin = pos+1;
mode = MODE_TEXT;
}
else
{
++pos;
char* base = pos;
while (!isspace(*pos) && *pos != '>')
{
++pos;
if (pos == end)
goto parse_failed;
}
char ctemp = *pos;
*pos = '\0';
//printf("new tag name = %s\n", base);
//++pos;
XML* temp = (XML*) malloc(sizeof(XML));
XML_Init(temp, base);
if (!root)
root = temp;
else
XML_AddChildNode(curnode, temp);
curnode = temp;
*pos = ctemp;
pos--;
mode = MODE_TAG;
}
}
}
else if (mode == MODE_TAG)
{
if (!isspace(*pos))
{
switch (*pos)
{
case '>':
{
if (pos[-1] == '/')
{
//printf("self close start = %s\n", curnode->name);
curnode = curnode->parent;
//printf("self close end = %s\n", curnode->name);
}
curTextBegin = pos+1;
mode = MODE_TEXT;
break;
}
case '/':
{
break;
}
default: // attribute name
{
char* name_base = pos;
while (*pos != '=')
{
++pos;
if (pos == end)
goto parse_failed;
}
*pos = '\0';
++pos;
if (*pos != '"')
goto parse_failed;
++pos;
char* value_base = pos;
while (*pos != '"')
{
++pos;
if (pos == end)
goto parse_failed;
}
*pos = '\0';
//printf("attribute tag:%s %s=%s\n", curnode->name, name_base, value_base);
XML_SetAttribute(curnode, name_base, value_base);
break;
}
};
}
}
++pos;
}
free(doc);
return root;
parse_failed:
//printf("what?!\n");
if (root)
XML_Destroy(root);
free(doc);
return NULL;
}
XML* XML_OpenFile(const char* filename)
{
FILE* fp = fopen(filename, "rb");
if (fp)
{
fseek(fp, 0, SEEK_END);
int32 filesize = ftell(fp);
fseek(fp, 0, SEEK_SET);
char* szTemp = (char*) malloc(filesize+1);
fread(szTemp, 1, filesize, fp);
szTemp[filesize] = '\0';
fclose(fp);
XML* tempXML = XML_Parse(szTemp);
free(szTemp);
return tempXML;
}
return NULL;
}
uint32 XML_SaveFile(XML* p, const char* filename)
{
return 1;
}
\ No newline at end of file
#if !defined(AFX_XML_H__D9F1340C_4C0C_4F5C_A646_46D6D74C3489__INCLUDED_)
#define AFX_XML_H__D9F1340C_4C0C_4F5C_A646_46D6D74C3489__INCLUDED_
#include "main_stuff.h"
#include "punk_array.h"
START_EXTERN_C
typedef struct SXML
{
char* name;
char* text;
DECLARE_PUNK_ARRAY(children, struct SXML*);
DECLARE_PUNK_ARRAY(attribute_names, char*);
DECLARE_PUNK_ARRAY(attribute_values, char*);
struct SXML* parent;
char parent_delete;
} XML;
extern uint32 XML_resize_count;
void XML_Init(XML* p, const char* szName /*= NULL*/);
void XML_Destroy(XML* p);
void XML_SetText(XML* p, const char* szText);
void XML_AppendText(XML* p, const char* szText);
void XML_AddChildNode(XML* p, XML* node);
XML* XML_AddChild(XML* p, const char* szName);
void XML_SetAttribute(XML* p, const char* name, const char* value);
const char* XML_GetAttribute(XML* p, const char* name);
const char* XML_GetAttributeString(XML* p, const char* name, const char* szDefault);
int32 XML_GetAttributeInt(XML* p, const char* name, int32 iDefault);
uint32 XML_GetAttributeHex(XML* p, const char* name, uint32 uiDefault);
XML* XML_Find(XML* p, const char* tagname, const char* attr_name /*= NULL*/, const char* attr_val /*= NULL*/);
XML* XML_Parse(const char* szDoc);
XML* XML_OpenFile(const char* filename);
uint32 XML_SaveFile(XML* p, const char* filename);
END_EXTERN_C
#endif
<nesterdcse_builder
roms_path="C:\cygwin\home\Administrator\nesroms\favs"
dest_path="datatemp"
library_url="http://www.sch3rz0.com/nesterdcse/master_library"
stage_path="/home/Administrator/projects/new_nesterdcse/cd"
get_carts="true"
get_manuals="true"
get_faqs="true"
get_titles="true"
get_screenshots="true"
get_boxes="true"
get_nsfs="true"
get_gamegenie="true"
image_format="0"
/>
<nesterdcse_builder
roms_path="C:\cygwin\home\Administrator\nesroms\favs"
dest_path="datatemp"
library_url="http://www.sch3rz0.com/nesterdcse/master_library"
stage_path="/home/Administrator/projects/new_nesterdcse/cd"
get_carts="true"
get_manuals="true"
get_faqs="true"
get_titles="true"
get_screenshots="true"
get_boxes="true"
get_nsfs="true"
get_gamegenie="true"
/>
This diff is collapsed.
#ifndef __CDBUILDTHREAD_H__
#define __CDBUILDTHREAD_H__
#include <wx/thread.h>
#include <wx/wx.h>
class MyDlg;
class CDBuildThread : public wxThread
{
public:
CDBuildThread(const char* cfgFile, wxTextCtrl* txtOut, MyDlg* pDlg);
virtual wxThread::ExitCode Entry();
private:
wxString configFile;
wxTextCtrl* txtOutput;
MyDlg* dlg;
};
#endif
/*
---------------------------------------------------------------------------
Copyright (c) 2003, Dominik Reichl <dominik.reichl@t-online.de>, Germany.
All rights reserved.
Distributed under the terms of the GNU General Public License v2.
This software is provided 'as is' with no explicit or implied warranties
in respect of its properties, including, but not limited to, correctness
and/or fitness for purpose.
---------------------------------------------------------------------------
*/
#include "crc32cool.h"
// CRC-32 polynominal:
// X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X+1
static unsigned long crc32tab[] = {
0x00000000L, 0x77073096L, 0xEE0E612CL, 0x990951BAL,
0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L,
0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L,
0x09B64C2BL, 0x7EB17CBDL, 0xE7B82D07L, 0x90BF1D91L,
0x1DB71064L, 0x6AB020F2L, 0xF3B97148L, 0x84BE41DEL,
0x1ADAD47DL, 0x6DDDE4EBL, 0xF4D4B551L, 0x83D385C7L,
0x136C9856L, 0x646BA8C0L, 0xFD62F97AL, 0x8A65C9ECL,
0x14015C4FL, 0x63066CD9L, 0xFA0F3D63L, 0x8D080DF5L,
0x3B6E20C8L, 0x4C69105EL, 0xD56041E4L, 0xA2677172L,
0x3C03E4D1L, 0x4B04D447L, 0xD20D85FDL, 0xA50AB56BL,
0x35B5A8FAL, 0x42B2986CL, 0xDBBBC9D6L, 0xACBCF940L,
0x32D86CE3L, 0x45DF5C75L, 0xDCD60DCFL, 0xABD13D59L,
0x26D930ACL, 0x51DE003AL, 0xC8D75180L, 0xBFD06116L,
0x21B4F4B5L, 0x56B3C423L, 0xCFBA9599L, 0xB8BDA50FL,
0x2802B89EL, 0x5F058808L, 0xC60CD9B2L, 0xB10BE924L,
0x2F6F7C87L, 0x58684C11L, 0xC1611DABL, 0xB6662D3DL,
0x76DC4190L, 0x01DB7106L, 0x98D220BCL, 0xEFD5102AL,
0x71B18589L, 0x06B6B51FL, 0x9FBFE4A5L, 0xE8B8D433L,
0x7807C9A2L, 0x0F00F934L, 0x9609A88EL, 0xE10E9818L,
0x7F6A0DBBL, 0x086D3D2DL, 0x91646C97L, 0xE6635C01L,
0x6B6B51F4L, 0x1C6C6162L, 0x856530D8L, 0xF262004EL,
0x6C0695EDL, 0x1B01A57BL, 0x8208F4C1L, 0xF50FC457L,
0x65B0D9C6L, 0x12B7E950L, 0x8BBEB8EAL, 0xFCB9887CL,
0x62DD1DDFL, 0x15DA2D49L, 0x8CD37CF3L, 0xFBD44C65L,
0x4DB26158L, 0x3AB551CEL, 0xA3BC0074L, 0xD4BB30E2L,
0x4ADFA541L, 0x3DD895D7L, 0xA4D1C46DL, 0xD3D6F4FBL,
0x4369E96AL, 0x346ED9FCL, 0xAD678846L, 0xDA60B8D0L,
0x44042D73L, 0x33031DE5L, 0xAA0A4C5FL, 0xDD0D7CC9L,
0x5005713CL, 0x270241AAL, 0xBE0B1010L, 0xC90C2086L,
0x5768B525L, 0x206F85B3L, 0xB966D409L, 0xCE61E49FL,
0x5EDEF90EL, 0x29D9C998L, 0xB0D09822L, 0xC7D7A8B4L,
0x59B33D17L, 0x2EB40D81L, 0xB7BD5C3BL, 0xC0BA6CADL,
0xEDB88320L, 0x9ABFB3B6L, 0x03B6E20CL, 0x74B1D29AL,
0xEAD54739L, 0x9DD277AFL, 0x04DB2615L, 0x73DC1683L,
0xE3630B12L, 0x94643B84L, 0x0D6D6A3EL, 0x7A6A5AA8L,
0xE40ECF0BL, 0x9309FF9DL, 0x0A00AE27L, 0x7D079EB1L,
0xF00F9344L, 0x8708A3D2L, 0x1E01F268L, 0x6906C2FEL,
0xF762575DL, 0x806567CBL, 0x196C3671L, 0x6E6B06E7L,
0xFED41B76L, 0x89D32BE0L, 0x10DA7A5AL, 0x67DD4ACCL,
0xF9B9DF6FL, 0x8EBEEFF9L, 0x17B7BE43L, 0x60B08ED5L,
0xD6D6A3E8L, 0xA1D1937EL, 0x38D8C2C4L, 0x4FDFF252L,
0xD1BB67F1L, 0xA6BC5767L, 0x3FB506DDL, 0x48B2364BL,
0xD80D2BDAL, 0xAF0A1B4CL, 0x36034AF6L, 0x41047A60L,
0xDF60EFC3L, 0xA867DF55L, 0x316E8EEFL, 0x4669BE79L,
0xCB61B38CL, 0xBC66831AL, 0x256FD2A0L, 0x5268E236L,
0xCC0C7795L, 0xBB0B4703L, 0x220216B9L, 0x5505262FL,
0xC5BA3BBEL, 0xB2BD0B28L, 0x2BB45A92L, 0x5CB36A04L,
0xC2D7FFA7L, 0xB5D0CF31L, 0x2CD99E8BL, 0x5BDEAE1DL,
0x9B64C2B0L, 0xEC63F226L, 0x756AA39CL, 0x026D930AL,
0x9C0906A9L, 0xEB0E363FL, 0x72076785L, 0x05005713L,
0x95BF4A82L, 0xE2B87A14L, 0x7BB12BAEL, 0x0CB61B38L,
0x92D28E9BL, 0xE5D5BE0DL, 0x7CDCEFB7L, 0x0BDBDF21L,
0x86D3D2D4L, 0xF1D4E242L, 0x68DDB3F8L, 0x1FDA836EL,
0x81BE16CDL, 0xF6B9265BL, 0x6FB077E1L, 0x18B74777L,
0x88085AE6L, 0xFF0F6A70L, 0x66063BCAL, 0x11010B5CL,
0x8F659EFFL, 0xF862AE69L, 0x616BFFD3L, 0x166CCF45L,
0xA00AE278L, 0xD70DD2EEL, 0x4E048354L, 0x3903B3C2L,
0xA7672661L, 0xD06016F7L, 0x4969474DL, 0x3E6E77DBL,
0xAED16A4AL, 0xD9D65ADCL, 0x40DF0B66L, 0x37D83BF0L,
0xA9BCAE53L, 0xDEBB9EC5L, 0x47B2CF7FL, 0x30B5FFE9L,
0xBDBDF21CL, 0xCABAC28AL, 0x53B39330L, 0x24B4A3A6L,
0xBAD03605L, 0xCDD70693L, 0x54DE5729L, 0x23D967BFL,
0xB3667A2EL, 0xC4614AB8L, 0x5D681B02L, 0x2A6F2B94L,
0xB40BBE37L, 0xC30C8EA1L, 0x5A05DF1BL, 0x2D02EF8DL
};
void crc32Init(unsigned long *pCrc32)
{
*pCrc32 = 0xFFFFFFFF;
}
void crc32Update(unsigned long *pCrc32, unsigned char *pData, unsigned long uSize)
{
unsigned long i = 0;
for(i = 0; i < uSize; i++)
*pCrc32 = ((*pCrc32) >> 8) ^ crc32tab[(pData[i]) ^ ((*pCrc32) & 0x000000FF)];
}
// Make the final adjustment
void crc32Finish(unsigned long *pCrc32)
{
*pCrc32 = ~(*pCrc32);
}
/*
---------------------------------------------------------------------------
Copyright (c) 2003, Dominik Reichl <dominik.reichl@t-online.de>, Germany.
All rights reserved.
Distributed under the terms of the GNU General Public License v2.
This software is provided 'as is' with no explicit or implied warranties
in respect of its properties, including, but not limited to, correctness
and/or fitness for purpose.
---------------------------------------------------------------------------
*/
#ifndef ___CRC32_H___
#define ___CRC32_H___
#ifdef __cplusplus
extern "C"
{
#endif
void crc32Init(unsigned long *pCrc32);
void crc32Update(unsigned long *pCrc32, unsigned char *pData, unsigned long uSize);
void crc32Finish(unsigned long *pCrc32);
#ifdef __cplusplus
}
#endif
#endif /* ___CRC32_H___ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment