Previous Thread
Next Thread
Print Thread
Page 2 of 9 1 2 3 4 5 6 7 8 9
Joined: Jan 2012
Posts: 1,162
Likes: 7
rfka01 Offline OP
Very Senior Member
OP Offline
Very Senior Member
Joined: Jan 2012
Posts: 1,162
Likes: 7
Welome @helwie44 ... who operates a site on the P2 that I've linked to before and who has worked on the SKS family machines (SKS nano, ITT 3030 and the Alphatronic P1-P4 range).


NCR DMV- DEC Rainbow- Siemens PCD- ITT 3030-Oly People- Acorn A5000- Olivetti M20
Joined: May 2004
Posts: 961
Likes: 23
D
Senior Member
Offline
Senior Member
D
Joined: May 2004
Posts: 961
Likes: 23
Hello and welcome helwie44, I'm not currently working on the Alphatronic machines. It's very nice to see someone who did lots of work on those machines here though.

Eventually I'll continue to work on it (if someone else isn't picking up the driver), then I'll be sure to contact you.

The range 0x3ff0 to 0x3ffe is already forwarded to the crt registers, see https://git.redump.net/mame/tree/src/mame/drivers/alphatpx.cpp#n65 (0x37f0 with mirror 0x800 so it's at 0x37f0 and 0x3ff0).

Joined: Jan 2012
Posts: 1,162
Likes: 7
rfka01 Offline OP
Very Senior Member
OP Offline
Very Senior Member
Joined: Jan 2012
Posts: 1,162
Likes: 7
Snapshot of current state of alphatpx.cpp at https://github.com/rfka01/mame, ROMs and soft on the FTP.


NCR DMV- DEC Rainbow- Siemens PCD- ITT 3030-Oly People- Acorn A5000- Olivetti M20
Joined: Dec 2015
Posts: 147
Likes: 3
A
AJR Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2015
Posts: 147
Likes: 3
p3_keyboard_mab8041a.bin looks like an alternate revision of p3_keyboard_8278.bin. However, the former is a bad dump, with D2 equal to A2 in every byte.

Joined: Jan 2012
Posts: 881
Likes: 10
C
Senior Member
Offline
Senior Member
C
Joined: Jan 2012
Posts: 881
Likes: 10
rfka01: I left a PR in your fork to mess with.

Joined: Jan 2012
Posts: 881
Likes: 10
C
Senior Member
Offline
Senior Member
C
Joined: Jan 2012
Posts: 881
Likes: 10
[Linked Image]

Joined: Jan 2012
Posts: 1,162
Likes: 7
rfka01 Offline OP
Very Senior Member
OP Offline
Very Senior Member
Joined: Jan 2012
Posts: 1,162
Likes: 7
In a swell foop crazyc got the P3 to boot ... the exemplary disk spiele.img boots (others at ftp://ftp.informatik.uni-stuttgart.de/pub/cm/alphatronic/p3/ have issues with copy protection that might not have been transferred into the image, people have problems saving them back to disks and booting them on the real thing).

I need some help understanding the bankdev'd memory map:

Code
static ADDRESS_MAP_START( alphatp3_map, AS_PROGRAM, 8, alphatpx_state )
	AM_RANGE(0x00000, 0x017ff) AM_READ_BANK("rom") AM_WRITE_BANK("ram_0000")  
	AM_RANGE(0x01800, 0x02fff) AM_RAMBANK("ram_1800")						  
	AM_RANGE(0x03000, 0x03bff) AM_RAM AM_SHARE("vram")						  
	AM_RANGE(0x03FF0, 0x03fff) AM_DEVREADWRITE("crtc", crt5037_device, read, write) //test hw

	AM_RANGE(0x04000, 0x0ffff) AM_RAMBANK("ram_4000")
	AM_RANGE(0x10000, 0x1ffff) AM_RAMBANK("ram")
ADDRESS_MAP_END


and

Code
WRITE8_MEMBER(alphatpx_state::bank_w)
{
	m_bankdev->set_bank(BIT(data, 6));
}


Does that mean that depending on the state of bit 6 of bank_w, either "rom" or "ram_0000" is selected?

Why is the line
Code
AM_RANGE(0x10000, 0x1ffff) AM_RAMBANK("ram")
needed, as it specifies 64K-128K RAM in a strictly 64K system?

If I omit it, MAME crashes with the error

Code
-----------------------------------------------------
Exception at EIP=000000000226b37f (memory_bank::set_base(void*)+0x000f): ACCESS VIOLATION
While attempting to read memory at 0000000000000008
-----------------------------------------------------
RAX=0000000000000000 RBX=0000000020b5b8d0 RCX=0000000000000000 RDX=000000002aaf4f50
RSI=000000002aaf4f50 RDI=00000000000012b8 RBP=000000001c308240 RSP=000000001c308220
 R8=000000000001b6b3  R9=0000000000000004 R10=000000000000000f R11=000000001c308200
R12=0000000000000000 R13=0000000000000001 R14=000000001c308790 R15=0000000004dc0168
-----------------------------------------------------
Stack crawl:
  000000001c308230: 000000000226b37f (memory_bank::set_base(void*)+0x000f)
  000000001c3082c0: 0000000000b7f67e (alphatpx_state::machine_start()+0x010e)
  000000001c308310: 0000000002264bc3 (driver_device::device_start()+0x02f3)
  000000001c308420: 000000000221c4d0 (device_t::start()+0x0090)
  000000001c3084a0: 00000000022ba992 (running_machine::start_all_devices()+0x00c2)
  000000001c3085a0: 00000000022bf44f (running_machine::start()+0x085f)
  000000001c3086a0: 00000000022c0ad0 (running_machine::run(bool)+0x0140)
  000000001c30f250: 0000000000eb1493 (mame_machine_manager::execute()+0x01e3)
  000000001c30f4f0: 0000000000f22d29 (cli_frontend::start_execution(mame_machine_manager*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x03f9)
  000000001c30f680: 0000000000f231a5 (cli_frontend::execute(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)+0x0045)
  000000001c30f6e0: 0000000000eaf52a (emulator_info::start_frontend(emu_options&, osd_interface&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)+0x002a)
  000000001c30fe50: 00000000041b221d (main+0x013d)
  000000001c30ff20: 00000000004013f8 (__tmainCRTStartup+0x0248)
  000000001c30ff50: 000000000040151b (mainCRTStartup+0x001b)
  000000001c30ff80: 00007ffcc48f1fe4 (BaseThreadInitThunk+0x0014)
  000000001c30ffd0: 00007ffcc714ef91 (RtlUserThreadStart+0x0021)
Segmentation fault


How do I read the lines in machine start

Code
	membank("rom")->set_base(memregion("boot")->base());
	membank("ram_0000")->set_base(m_ram.get() + 0x0000);
	membank("ram_1800")->set_base(m_ram.get() + 0x1800);
	membank("ram_4000")->set_base(m_ram.get() + 0x4000);
	membank("ram")->set_base(m_ram.get());


Returning to the address map, can memory regions be grouped and banked in and out - the P3 swaps between 0x0000-0x3fff RAM and ROM/RAM1800/VRAM/CRTC for every access to the video memory, disk routines et al. - at the moment I think only 0x0000-0x17ff get swapped.


NCR DMV- DEC Rainbow- Siemens PCD- ITT 3030-Oly People- Acorn A5000- Olivetti M20
Joined: Mar 2001
Posts: 16,923
Likes: 57
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,923
Likes: 57
The bankdev device is very powerful: it maps a sliding-window view of its own address map into the source address map.

The key is here:

MCFG_ADDRESS_MAP_BANK_STRIDE(0x10000)

That means that the number you pass to set_bank is multiplied by that to get where in the bankdev's address map is visible in the main address map.

So Z80 address 0 is 0 in the bankdev's map when set_bank(0), and Z80 address 0 is 0x10000 in the bankdev's map when set_bank(1). MAME crashes when you omit the RAM because it's not an additional 64K, it's the base 64K for CP/M mode where 100% of the 64K is usable RAM.

The bonus of all of this over conventional banking in MAME is that it's much faster when the bank view changes frequently, because it's only updating the base address of the sliding window. The "new" 2014 Apple II driver was about 3 times faster simply because I changed it to use bankdev instead of the old-style banking.

Joined: Mar 2001
Posts: 16,923
Likes: 57
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,923
Likes: 57
Also, these lines

Code
	membank("rom")->set_base(memregion("boot")->base());
	membank("ram_0000")->set_base(m_ram.get() + 0x0000);
	membank("ram_1800")->set_base(m_ram.get() + 0x1800);
	membank("ram_4000")->set_base(m_ram.get() + 0x4000);
	membank("ram")->set_base(m_ram.get());


...map the various RAM views in bank 0 to their correct places in the full 64K in bank 1.

Joined: Jan 2012
Posts: 881
Likes: 10
C
Senior Member
Offline
Senior Member
C
Joined: Jan 2012
Posts: 881
Likes: 10
I did some of this in a new PR but there are still issues with the way the rom is mapped. MBasic for example tries to do CP/M syscalls (CALL 5) while the rom is mapped in resulting in a branch to the wrong place.

Page 2 of 9 1 2 3 4 5 6 7 8 9

Link Copied to Clipboard
Who's Online Now
2 members (judge, MAMEBase), 29 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,103
Posts119,280
Members5,019
Most Online890
Jan 17th, 2020
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com