From a2d73e4c46e74d55201ba70e273ce8083e820587 Mon Sep 17 00:00:00 2001 From: Allofich <19624336+Allofich@users.noreply.github.com> Date: Sat, 13 Sep 2025 02:26:12 +0900 Subject: [PATCH] SVN r4492, r4493, r4494 --- CHANGELOG | 3 +++ src/hardware/mpu401.cpp | 1 - src/ints/ems.cpp | 39 +++++++++++++++++++++------------------ src/shell/shell_batch.cpp | 7 +++++++ 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8970d6ad9..5d5c294f6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -52,6 +52,9 @@ Next version r4487: Correct panning of VESA text modes. r4488: Correct comment about odd/even bit. r4490: Set MCB ownership when *blocks==total at end of DOS_ResizeMemory. + r4492: Don't clear message queues of MPU-401 and compatibles on reset. + r4493: Handle EOF character in batch files as actual end of file. + r4494: Use 4-byte partial page mapping data. - Replaced deprecated functions to enable building with FFmpeg 8 (maron2000) - Fixed screen blanked when restoring minimized window in TTF mode (Windows SDL1) (maron2000) diff --git a/src/hardware/mpu401.cpp b/src/hardware/mpu401.cpp index 5cf2fcc2d..e301aca46 100644 --- a/src/hardware/mpu401.cpp +++ b/src/hardware/mpu401.cpp @@ -644,7 +644,6 @@ static void MPU401_Reset(void) { mpu.clock.clock_to_host=false; mpu.clock.cth_rate=60; mpu.clock.cth_counter=0; - ClrQueue(); mpu.state.req_mask=0; mpu.condbuf.counter=0; mpu.clock.cth_savecount=0; diff --git a/src/ints/ems.cpp b/src/ints/ems.cpp index da9c0c53f..0ee16a91f 100644 --- a/src/ints/ems.cpp +++ b/src/ints/ems.cpp @@ -624,7 +624,7 @@ static uint8_t EMM_GetPagesForAllHandles(PhysPt table,uint16_t & handles) { } static uint8_t EMM_PartialPageMapping(void) { - PhysPt list,data;uint16_t count; + PhysPt list,data;uint16_t count,page; switch (reg_al) { case 0x00: /* Save Partial Page Map */ list = SegPhys(ds)+reg_si; @@ -634,37 +634,40 @@ static uint8_t EMM_PartialPageMapping(void) { for (;count>0;count--) { uint16_t segment=mem_readw(list);list+=2; if ((segment>=EMM_PAGEFRAME) && (segment>4u); - mem_writew(data,segment);data+=2; - MEM_BlockWrite(data,&emm_mappings[page],sizeof(EMM_Mapping)); - data+=sizeof(EMM_Mapping); + page=(segment-EMM_PAGEFRAME)>>10; + mem_writeb(data++,(uint8_t)page); + mem_writeb(data++,(uint8_t)emm_mappings[page].handle); + mem_writew(data,emm_mappings[page].page); } else if ((ems_type == EMS_MIXED) || (ems_type == EMS_EMM386) || ((segment>=EMM_PAGEFRAME-0x1000) && (segment=0xa000) && (segment<0xb000))) { - mem_writew(data,segment);data+=2; - MEM_BlockWrite(data,&emm_segmentmappings[segment>>10u],sizeof(EMM_Mapping)); - data+=sizeof(EMM_Mapping); + page=segment>>10; + mem_writeb(data++,(uint8_t)page); + mem_writeb(data++,(uint8_t)emm_segmentmappings[page].handle); + mem_writew(data,emm_segmentmappings[page].page); } else { return EMM_ILL_PHYS; } + data+=2; } break; case 0x01: /* Restore Partial Page Map */ data = SegPhys(ds)+reg_si; count= mem_readw(data);data+=2; for (;count>0;count--) { - uint16_t segment=mem_readw(data);data+=2; - if ((segment>=EMM_PAGEFRAME) && (segment>4); - MEM_BlockRead(data,&emm_mappings[page],sizeof(EMM_Mapping)); - } else if ((ems_type == EMS_MIXED) || (ems_type == EMS_EMM386) || ((segment>=EMM_PAGEFRAME-0x1000) && (segment=0xa000) && (segment<0xb000))) { - MEM_BlockRead(data,&emm_segmentmappings[segment>>10u],sizeof(EMM_Mapping)); + page=(uint16_t)mem_readb(data++); + if (page>6u)+(unsigned int)(ct*0x10u); real_writew(SegValue(es),entry_addr+0x00u+0x01u,(memh+0u)*0x10u); // mapping of 1/4 of page @@ -1152,7 +1155,7 @@ static Bitu INT67_Handler(void) { else if (mem_seg0) { + if (c==0x1a) { + // Stop at EOF character + n=0; + this->location=0; + DOS_SeekFile(file_handle,&(this->location),DOS_SEEK_END); + break; + } /* Why are we filtering this ? * Exclusion list: tab for batch files * escape for ansi