src/mess/machine/comx35.c
| r2658 | r2659 | |
| 602 | 602 | image_fread(image, ptr, count);
|
| 603 | 603 | }
|
| 604 | 604 | |
| 605 | | static void write_memory(UINT16 addr, UINT8 data)
|
| 606 | | {
|
| 607 | | UINT8 *ptr = (UINT8 *) memory_get_write_ptr(0, ADDRESS_SPACE_PROGRAM, addr);
|
| 608 | | |
| 609 | | ptr[0] = data;
|
| 610 | | }
|
| 611 | | |
| 612 | | static UINT8 read_memory(UINT16 addr)
|
| 613 | | {
|
| 614 | | UINT8 *ptr = (UINT8 *) memory_get_read_ptr(0, ADDRESS_SPACE_PROGRAM, addr);
|
| 615 | | |
| 616 | | return ptr[0];
|
| 617 | | }
|
| 618 | | |
| 619 | 605 | QUICKLOAD_LOAD( comx35 )
|
| 620 | 606 | {
|
| 621 | 607 | UINT8 header[16] = {0};
|
| r2658 | r2659 | |
| 741 | 727 | image_fread(image, header, 2);
|
| 742 | 728 | |
| 743 | 729 | array_length = (header[0] << 8) | header[1];
|
| 744 | | start_array = (read_memory(0x4295) << 8) | read_memory(0x4296);
|
| 730 | start_array = (program_read_byte(0x4295) << 8) | program_read_byte(0x4296);
|
| 745 | 731 | end_array = start_array + (size - 7);
|
| 746 | 732 | |
| 747 | | write_memory(0x4299, end_array >> 8);
|
| 748 | | write_memory(0x429a, end_array & 0xff);
|
| 733 | program_write_byte(0x4299, end_array >> 8);
|
| 734 | program_write_byte(0x429a, end_array & 0xff);
|
| 749 | 735 |
|
| 750 | 736 | start_string = start_array + array_length;
|
| 751 | 737 | |
| 752 | | write_memory(0x4292, start_string >> 8);
|
| 753 | | write_memory(0x4293, start_string & 0xff);
|
| 738 | program_write_byte(0x4292, start_string >> 8);
|
| 739 | program_write_byte(0x4293, start_string & 0xff);
|
| 754 | 740 | |
| 755 | 741 | image_fread_memory(image, start_array, size);
|
| 756 | 742 | }
|