// File: /workspace/github_c_makefile_star2_O2/calmopyrin[P]tedplay/Tedmem.cpp
// Function: TED::dump(void*)
void TED::dump(void *img)
{
	// this is ugly :-P
   	fwrite(Ram,RAMSIZE,1,(FILE *) img);
	fwrite(&RAMenable,sizeof(RAMenable),1,(FILE *) img);
	fwrite(&t1start,sizeof(t1start),1, (FILE *) img);
	fwrite(&t1on,sizeof(t1on),1, (FILE *) img);
	fwrite(&t2on,sizeof(t2on),1, (FILE *) img);
	fwrite(&t3on,sizeof(t3on),1, (FILE *) img);
	fwrite(&timer1,sizeof(timer1),1, (FILE *) img);
	fwrite(&timer2,sizeof(timer2),1, (FILE *) img);
	fwrite(&timer3,sizeof(timer3),1, (FILE *) img);
	fwrite(&beamx,sizeof(beamx),1, (FILE *) img);
	fwrite(&beamy,sizeof(beamy),1, (FILE *) img);
	//fwrite(&x,sizeof(x),1, (FILE *) img);
	fwrite(&irqline,sizeof(irqline),1, (FILE *) img);
	fwrite(&crsrpos,sizeof(crsrpos),1, (FILE *) img);
	fwrite(&scrattr,sizeof(scrattr),1, (FILE *) img);
	fwrite(&tmp,sizeof(tmp),1, (FILE *) img);
	fwrite(&nrwscr,sizeof(nrwscr),1, (FILE *) img);
	fwrite(&hshift,sizeof(hshift),1, (FILE *) img);
	fwrite(&vshift,sizeof(vshift),1, (FILE *) img);
	fwrite(&fltscr,sizeof(fltscr),1, (FILE *) img);
	fwrite(&mcol,sizeof(mcol),1, (FILE *) img);
	fwrite(chrbuf,40,1, (FILE *) img);
	fwrite(clrbuf,40,1, (FILE *) img);
	fwrite(&charrom,sizeof(charrom),1, (FILE *) img);
	fwrite(&charbank,sizeof(charbank),1, (FILE *) img);
//	fwrite(&TEDfreq1,sizeof(TEDfreq1),1, (FILE *) img);
//	fwrite(&TEDfreq2,sizeof(TEDfreq2),1, (FILE *) img);
//	fwrite(&TEDVolume,sizeof(TEDVolume),1, (FILE *) img);
//	fwrite(&TEDDA,sizeof(TEDDA),1, (FILE *) img);
	fwrite(&framecol,sizeof(framecol),1, (FILE *) img);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x45fc0, %rdi          # imm = 0x45FC0
pushq $0x1
popq %r15
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
movsbl 0x18(%r14), %edi
movq %rbx, %rsi
callq 0x3280
leaq 0x65fd0(%r14), %rdi
pushq $0x4
popq %r12
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
movsbl 0x65fc0(%r14), %edi
movq %rbx, %rsi
callq 0x3280
movsbl 0x65fc1(%r14), %edi
movq %rbx, %rsi
callq 0x3280
movsbl 0x65fc2(%r14), %edi
movq %rbx, %rsi
callq 0x3280
leaq 0x65fc4(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0x65fc8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0x65fcc(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0x81c(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0x820(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb6184(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0x45fa8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb6130(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0x1aa3b(%rip), %rdi     # 0x254c8
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb6024(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb601c(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb6020(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb6028(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
leaq 0xb618a(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
movq 0xb60f0(%r14), %rdi
pushq $0x28
popq %r13
movq %r13, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
movq 0xb60f8(%r14), %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
movsbl 0xb6120(%r14), %edi
movq %rbx, %rsi
callq 0x3280
leaq 0xb6134(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x33a0
addq $0xb6138, %r14          # imm = 0xB6138
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x33a0