// File: khedoros[P]khednes/rom.cpp
// Function: rom::print_info()
void rom::print_info() {
    std::cout<<"Filename: "<<file.c_str()<<std::endl;
    std::cout<<"Filesize: "<<filesize<<std::endl;
    std::cout<<"Valid: "<<(valid?"true":"false")<<std::endl;
    std::cout<<"PROM pages: "<<prom_pages<<std::endl;
    std::cout<<"CROM pages: "<<crom_pages<<std::endl;
    std::cout<<"Trainer: "<<(trainer?"true":"false")<<std::endl;
    std::cout<<"Mirror mode: ";
    switch(mirror_mode) {
        case VERT:
            std::cout<<"Vertical mirroring"<<std::endl;
            break;
        case HORIZ:
            std::cout<<"Horizontal mirroring"<<std::endl;
            break;
        case FOUR_SCR:
            std::cout<<"4-Screen mirroring"<<std::endl;
            break;
    }
    std::cout<<"Contains SRAM: "<<(sram?"true":"false")<<std::endl;
    std::cout<<"Mapper: "<<mapper_num<<std::endl;

    printf("RST Insertion point: %04x\n",rst_addr);
    printf("IRQ Insertion point: %04x\n",irq_addr);
    printf("NMI Insertion point: %04x\n",nmi_addr);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x27566(%rip), %rdi     # 0x36fb0
movq %rdi, 0x28(%rsp)
leaq 0x1bba0(%rip), %rsi     # 0x2b5f6
callq 0x43c0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rsp)
movq 0x70(%rax), %rdi
callq 0x41a0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x43c0
movq %rax, %rdi
movq 0x27508(%rip), %rsi     # 0x36f90
movq %rsi, 0x20(%rsp)
callq 0x4400
movq 0x28(%rsp), %rdi
leaq 0x1bb63(%rip), %rsi     # 0x2b601
callq 0x43c0
movq %rax, %rdi
movq 0x30(%rsp), %rax
movl 0x8c(%rax), %esi
callq 0x4660
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4400
movq 0x28(%rsp), %rdi
leaq 0x1bb3d(%rip), %rsi     # 0x2b60c
callq 0x43c0
movq %rax, %rdi
movq 0x30(%rsp), %rax
movb 0x8(%rax), %cl
leaq 0x1bb2e(%rip), %rax     # 0x2b614
movq %rax, 0x18(%rsp)
leaq 0x1bb27(%rip), %rsi     # 0x2b619
movq %rsi, 0x10(%rsp)
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x43c0
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4400
movq 0x28(%rsp), %rdi
leaq 0x1bb03(%rip), %rsi     # 0x2b61f
callq 0x43c0
movq %rax, %rdi
movq 0x30(%rsp), %rax
movl 0x78(%rax), %esi
callq 0x4660
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4400
movq 0x28(%rsp), %rdi
leaq 0x1bae2(%rip), %rsi     # 0x2b62c
callq 0x43c0
movq %rax, %rdi
movq 0x30(%rsp), %rax
movl 0x7c(%rax), %esi
callq 0x4660
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4400
movq 0x28(%rsp), %rdi
leaq 0x1bac1(%rip), %rsi     # 0x2b639
callq 0x43c0
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rcx
movq %rax, %rdi
movq 0x18(%rsp), %rax
movb 0xa1(%rcx), %cl
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x43c0
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4400
movq 0x28(%rsp), %rdi
leaq 0x1ba89(%rip), %rsi     # 0x2b643
callq 0x43c0
movq 0x30(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, 0x3c(%rsp)
testl %eax, %eax
je 0xfbea
jmp 0xfbd4
movl 0x3c(%rsp), %eax
subl $0x1, %eax
je 0xfc0e
jmp 0xfbdf
movl 0x3c(%rsp), %eax
subl $0x2, %eax
je 0xfc32
jmp 0xfc54
movq 0x273bf(%rip), %rdi     # 0x36fb0
leaq 0x1ba59(%rip), %rsi     # 0x2b651
callq 0x43c0
movq %rax, %rdi
movq 0x27389(%rip), %rsi     # 0x36f90
callq 0x4400
jmp 0xfc54
movq 0x2739b(%rip), %rdi     # 0x36fb0
leaq 0x1ba48(%rip), %rsi     # 0x2b664
callq 0x43c0
movq %rax, %rdi
movq 0x27365(%rip), %rsi     # 0x36f90
callq 0x4400
jmp 0xfc54
movq 0x27377(%rip), %rdi     # 0x36fb0
leaq 0x1ba39(%rip), %rsi     # 0x2b679
callq 0x43c0
movq %rax, %rdi
movq 0x27341(%rip), %rsi     # 0x36f90
callq 0x4400
movq 0x27355(%rip), %rdi     # 0x36fb0
leaq 0x1ba2a(%rip), %rsi     # 0x2b68c
callq 0x43c0
movq %rax, %rdi
movq 0x30(%rsp), %rax
movb 0xa0(%rax), %cl
leaq 0x1b99d(%rip), %rsi     # 0x2b619
leaq 0x1b991(%rip), %rax     # 0x2b614
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x43c0
movq %rax, %rdi
movq 0x272f7(%rip), %rsi     # 0x36f90
callq 0x4400
movq 0x2730b(%rip), %rdi     # 0x36fb0
leaq 0x1b9f0(%rip), %rsi     # 0x2b69c
callq 0x43c0
movq %rax, %rdi
movq 0x30(%rsp), %rax
movl 0x90(%rax), %esi
callq 0x4660
movq %rax, %rdi
movq 0x272c2(%rip), %rsi     # 0x36f90
callq 0x4400
movq 0x30(%rsp), %rax
movl 0x94(%rax), %esi
leaq 0x1b9c0(%rip), %rdi     # 0x2b6a5
movb $0x0, %al
callq 0x4050
movq 0x30(%rsp), %rax
movl 0x9c(%rax), %esi
leaq 0x1b9c2(%rip), %rdi     # 0x2b6c0
movb $0x0, %al
callq 0x4050
movq 0x30(%rsp), %rax
movl 0x98(%rax), %esi
leaq 0x1b9c4(%rip), %rdi     # 0x2b6db
movb $0x0, %al
callq 0x4050
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)