// File: /workspace/github_cpp_makefile_star2_O2/khedoros[P]khednes/rom.cpp
// Function: rom::print_nsf_info()
void rom::print_nsf_info() {
    std::cout<<"Filename: "<<file.c_str()<<std::endl;
    std::cout<<"Filesize: "<<filesize<<std::endl;
    std::cout<<"Valid: "<<(valid?"true":"false")<<std::endl;
    printf("Init Insertion point: %04x\n",rst_addr);
    printf("Load Insertion point: %04x\n",load_addr);
    printf("Tick Insertion point: %04x\n",nmi_addr);
    printf("Extra hardware flag: %02x", header[0x7b]);
    if(header[0x07b]) {
        printf(" (Extra sound chip support specified, and I don't currently support that.)");
    }
    printf("\n");

    printf("Songs in file: %d\n", song_count);
    printf("Starting song: %d\n", song_index+1);
    printf("Load addr: %04x\nInit addr: %04x\nPlay addr: %04x\n", load_addr, rst_addr, nmi_addr);
    printf("Song name: %s\nArtist: %s\nCopyright: %s\n", &header[0x0e], &header[0x2e], &header[0x4e]);

    printf("NTSC ticks (uS): %d\nPAL ticks (uS): %d\n", ntsc_ticks, pal_ticks);

    printf("NTSC: %d\n PAL: %d\n", ntsc,pal);

    printf("Bank map\n--------\n");
    for(int i=0;i<8;++i) {
        printf("%02x ", header[0x70+i]);
    }
    printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x12335(%rip), %r14     # 0x1afb0
leaq 0x98f4(%rip), %rsi      # 0x12576
movq %r14, %rdi
callq 0x4390
movq 0x70(%rbx), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x4390
movq %rax, %rdi
callq 0x41c0
leaq 0x98d9(%rip), %rsi      # 0x12581
movq %r14, %rdi
callq 0x4390
movl 0x8c(%rbx), %esi
movq %rax, %rdi
callq 0x4610
movq %rax, %rdi
callq 0x41c0
leaq 0x98bf(%rip), %rsi      # 0x1258c
movq %r14, %rdi
callq 0x4390
leaq 0x98b8(%rip), %rcx      # 0x12594
leaq 0x98b6(%rip), %rsi      # 0x12599
cmpb $0x0, 0x8(%rbx)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4390
movq %rax, %rdi
callq 0x41c0
movl 0x94(%rbx), %esi
leaq 0x996e(%rip), %rdi      # 0x12676
xorl %eax, %eax
callq 0x4040
movl 0xb8(%rbx), %esi
leaq 0x9976(%rip), %rdi      # 0x12692
xorl %eax, %eax
callq 0x4040
movl 0x98(%rbx), %esi
leaq 0x997e(%rip), %rdi      # 0x126ae
xorl %eax, %eax
callq 0x4040
movq 0x10(%rbx), %rax
movzbl 0x7b(%rax), %esi
leaq 0x9984(%rip), %rdi      # 0x126ca
xorl %eax, %eax
callq 0x4040
movq 0x10(%rbx), %rax
cmpb $0x0, 0x7b(%rax)
je 0x8d65
leaq 0x9986(%rip), %rdi      # 0x126e4
xorl %eax, %eax
callq 0x4040
pushq $0xa
popq %rdi
callq 0x44b0
movl 0xbc(%rbx), %esi
leaq 0x99b5(%rip), %rdi      # 0x1272f
xorl %eax, %eax
callq 0x4040
movl 0xc0(%rbx), %esi
incl %esi
leaq 0x99b2(%rip), %rdi      # 0x12742
xorl %eax, %eax
callq 0x4040
movl 0xb8(%rbx), %esi
movl 0x94(%rbx), %edx
movl 0x98(%rbx), %ecx
leaq 0x99a5(%rip), %rdi      # 0x12755
xorl %eax, %eax
callq 0x4040
movq 0x10(%rbx), %rcx
leaq 0xe(%rcx), %rsi
leaq 0x2e(%rcx), %rdx
addq $0x4e, %rcx
leaq 0x99b8(%rip), %rdi      # 0x12786
xorl %eax, %eax
callq 0x4040
movl 0xc4(%rbx), %esi
movl 0xc8(%rbx), %edx
leaq 0x99c6(%rip), %rdi      # 0x127ae
xorl %eax, %eax
callq 0x4040
movzbl 0xcd(%rbx), %esi
movzbl 0xcc(%rbx), %edx
leaq 0x99d2(%rip), %rdi      # 0x127d6
xorl %eax, %eax
callq 0x4040
leaq 0x9a8d(%rip), %rdi      # 0x1289f
callq 0x4540
leaq 0x966a(%rip), %r14      # 0x12488
xorl %r15d, %r15d
cmpq $0x8, %r15
je 0x8e40
movq 0x10(%rbx), %rax
movzbl 0x70(%rax,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x4040
incq %r15
jmp 0x8e21
pushq $0xa
popq %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x44b0
nop