Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08045 Misc. Major Always Aug 1, 2021, 14:05 Aug 1, 2021, 20:26
Tester sixxie View Status Public Platform MAME (Self-compiled)
Assigned To Pernod Resolution Fixed OS Linux (64-bit)
Status [?] Resolved Driver coco12.cpp
Version 0.234 Fixed in Version 0.235 Build 64-bit
Fixed in Git Commit c478e4e Github Pull Request #
Summary MESS-specific 08045: coco, coco2, dragon32: 32K machines present with one byte missing
Description Available memory to emulated machine is one byte short.
Steps To Reproduce Start a 32K machine, e.g. mame dragon32

POKE32767,1:PRINTPEEK(32767)
(expected: 1, got: 0)

Also obvious from the output of PRINT MEM on first startup.
Additional Information The upper bounds in m_ram_space within the SAM (6883) appear to be first initialised by a call from sam6883_device::display_read, but my C++ debugging skills are lacking when it comes to tracing this further. See attached log for a GDB session showing me:

 - setting breakpoint on sam6883_device constructor
 - skipping 17 calls to that constructor - last one before machine runs is the 18th
 - determining address of upper bounds variable (e.g. m_addrend_r) and setting watchpoint
 - observing the setting of variable to wrong value (32766 instead of 32767)

Then a backtrace. I think inferring how that value came to be needs to be done by someone already well-versed in the code.

GDB session log:

(gdb) break sam6883_device::sam6883_device
Breakpoint 22 at 0x4d9783: file ../../../../../src/mame/machine/6883sam.cpp, line 93.

(gdb) run dragon32
Starting program: /home/ciarana/package/mame/mame dragon32
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 22, sam6883_device::sam6883_device (this=0x529b350, mconfig=...,
    tag=0x3a0c295 "sam", owner=0x52989a0, clock=14218000)
    at ../../../../../src/mame/machine/6883sam.cpp:93
93 : device_t(mconfig, SAM6883, tag, owner, clock)

(gdb) c 17
Will ignore next 16 crossings of breakpoint 22. Continuing.
Error opening translation file English

Breakpoint 22, sam6883_device::sam6883_device (this=0x53bcc60, mconfig=...,
    tag=0x3a0c295 "sam", owner=0x53a8ed0, clock=14218000)
    at ../../../../../src/mame/machine/6883sam.cpp:93
93 : device_t(mconfig, SAM6883, tag, owner, clock)

(gdb) fin
Run till exit from #0 sam6883_device::sam6883_device (this=0x53bcc60, mconfig=...,
    tag=0x3a0c295 "sam", owner=0x53a8ed0, clock=14218000)
    at ../../../../../src/mame/machine/6883sam.cpp:93
0x00000000004ae5e0 in sam6883_device::sam6883_device<device_finder<cpu_device, true>&> (
    this=0x53bcc60, mconfig=..., tag=0x3a0c295 "sam", owner=0x53a8ed0, clock=14218000,
    cpu_tag=...) at ../../../../../src/mame/machine/6883sam.h:86
86 : sam6883_device(mconfig, tag, owner, clock)

(gdb) print &m_ram_space.m_addrend_r
$47 = (offs_t *) 0x53bd3c0

(gdb) watch *(offs_t *) 0x53bd3c0
Hardware watchpoint 23: *(offs_t *) 0x53bd3c0

(gdb) c
Continuing.
[New Thread 0x7ffff120d700 (LWP 473152)]
[New Thread 0x7ffff0a0c700 (LWP 473153)]
[New Thread 0x7fffebfff700 (LWP 473154)]
[New Thread 0x7fffeb7fe700 (LWP 473155)]
[New Thread 0x7ffff018b700 (LWP 473156)]
[New Thread 0x7fffeaffd700 (LWP 473157)]

Thread 1 "mame" hit Hardware watchpoint 23: *(offs_t *) 0x53bd3c0

Old value = 0
New value = 32766
handler_entry_read_dispatch<16, 0, 0>::lookup (this=0x6d134d0, address=0, start=@0x53bd3bc: 0,
    end=@0x53bd3c0: 32766, handler=@0x53bd3d0: 0x0)
    at ../../../../../src/emu/emumem_hedr.ipp:136
136 handler = h;

(gdb) bt

#0 handler_entry_read_dispatch<16, 0, 0>::lookup (this=0x6d134d0, address=0,
    start=@0x53bd3bc: 0, end=@0x53bd3c0: 32766, handler=@0x53bd3d0: 0x0)
    at ../../../../../src/emu/emumem_hedr.ipp:136
#1 0x00000000004dc717 in emu::detail::memory_access_cache<0, 0, (endianness_t)1>::check_address_r (this=0x53bd3b0, address=0) at ../../../../../src/emu/emumem.h:1120
#2 0x00000000004dc66e in emu::detail::memory_access_cache<0, 0, (endianness_t)1>::read_native
    (this=0x53bd3b0, address=0, mask=255 '\377') at ../../../../../src/emu/emumem.h:2008
#3 0x00000000004dbe40 in emu::detail::memory_access_cache<0, 0, (endianness_t)1>::read_byte (
    this=0x53bd3b0, address=0) at ../../../../../src/emu/emumem.h:1141
#4 0x00000000004e3781 in sam6883_device::display_read (this=0x53bcc60, offset=4294967295)
    at ../../../../../src/mame/machine/6883sam.h:117
#5 coco12_state::sam_read (this=0x53a8ed0, offset=4294967295)
    at ../../../../../src/mame/machine/coco12.cpp:68
#6 0x0000000001792b79 in delegate_base<unsigned char, unsigned int>::operator() (
    this=0x6e7b000, args=4294967295) at ../../../../../src/lib/util/delegate.h:511
#7 0x0000000001792ad1 in devcb_read_base::invoke_read<unsigned char, emu::device_delegate<unsigned char (unsigned int)> > (cb=..., offset=4294967295, mem_mask=255 '\377')
    at ../../../../../src/emu/devcb.h:247
#8 0x0000000001792a94 in devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> >::build<devcb_read<unsigned char, (unsigned char)255>::creator_impl<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> > >::create()::{lambda(auto:1&&)#1}>(devcb_read<unsigned char, (unsigned char)255>::creator_impl<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> > >::create()::{lambda(auto:1&&)#1}&&)::{lambda(unsigned int, unsigned char)#1}::operator()(unsigned int, unsigned char) const (
    this=0x6e7b000, offset=4294967295, mem_mask=255 '\377')
    at ../../../../../src/emu/devcb.h:619
#9 0x0000000001792a52 in devcb_read<unsigned char, (unsigned char)255>::creator_impl<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> > >::create()::{lambda(auto:1&&)#1}::operator()<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> >::build<{lambda(auto:1&&)#1}>({lambda(auto:1&&)#1}&&)::{lambda(unsigned int, unsigned char)#1}>({lambda(auto:1&&)#1}&&) const::{lambda(unsigned int, unsigned char)#1}::operator()(unsigned int, unsigned char) const (this=0x6e7b000, offset=4294967295, mem_mask=255 '\377')
    at ../../../../../src/emu/devcb.h:367
#10 0x0000000001792a17 in std::__invoke_impl<int, devcb_read<unsigned char, (unsigned char)255>::creator_impl<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> > >::create()::{lambda(auto:1&&)#1}::operator()<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> >::build<{lambda(auto:1&&)#1}>({lambda(auto:1&&)#1}&&)::{lambda(unsigned int, unsigned char)#1}>({lambda(auto:1&&)#1}&&) const::{lambda(unsigned int, unsigned char)#1}&, unsigned int, unsigned char>(std::__invoke_other, devcb_read<unsigned char, (unsigned char)255>::creator_impl<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> > >::create()::{lambda(auto:1&&)#1}::operator()<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> >::build<{lambda(auto:1&&)#1}>({lambda(auto:1&&)#1}&&)::{lambda(unsigned int, unsigned char)#1}>({lambda(auto:1&&)#1}&&) const::{lambda(unsigned int, unsigned char)#1}&, unsigned int&&, unsigned char&&) (
    __f=..., __args=@0x7fffffff7b93: 255 '\377', __args=@0x7fffffff7b93: 255 '\377')
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:60
#11 0x00000000017929a7 in std::__invoke_r<unsigned char, devcb_read<unsigned char, (unsigned char)255>::creator_impl<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> > >::create()::{lambda(auto:1&&)#1}::operator()<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> >::build<{lambda(auto:1&&)#1}>({lambda(auto:1&&)#1}&&)::{lambda(unsigned int, unsigned char)#1}>({lambda(auto:1&&)#1}&&) const::{lambda(unsigned int, unsigned char)#1}&, unsigned int, unsigned char>(devcb_read<unsigned char, (unsigned char)255>::creator_impl<devcb_read<unsigned char, (unsigned char)255>::delegate_builder<emu::device_delegate<unsigned char (unsigned int)> > >::create()::{lambda(auto:1&&)#1}::operator()<devcb_read<unsigned char, (unsigned char)255>::--Type <RET> for more, q to quit, c to continue without paging--q

(gdb) print m_a_ranges[0]
$49 = {start = 0, end = 32766}
Github Commit
Flags
Regression Version
Affected Sets / Systems coco, coco2, dragon32
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
0
There are no notes attached to this issue.