From: Ricky Z. <zha...@gm...> - 2017-09-23 23:04:40
|
Hi Simon, Any idea why your PR only works for X11 DGA but not SDL? If we could make it works in SDL, we can leverage David’s work in SDL2 that can zoom 512x384 in the hi-res screen. Also, we may be able to enable sound manager as well. Just for fun. BTW, I fixed emulated hard drive for Mac SE and Mac Classic ROM on top of my another patch in ROM break point. Now you can give a try of my fix in your repo. thanks, Ricky > On Sep 10, 2017, at 6:33 PM, Simon Frankau <sg...@ar...> wrote: > > Hi. > > Sorry I didn't reply earlier - spam filters. :( > > I'm definitely using 24-bit mode. I'm building to use X11, configured in banked mode. The ROMs are assuming the framebuffer lives at the end of RAM. Moreover, the framebuffer is not aligned to a 64K bank, so the existing framebuffer banking code doesn't work. > > I've written a pull request that copies these writes to the framebuffer - https://github.com/cebix/macemu/pull/131 <https://github.com/cebix/macemu/pull/131>. A slightly more "Basilisk-II-style" solution might be to map the framebuffer somewhere else into the 24-bit address space in 24-bit mode and tweak the ROM to write there instead, but that's beyond my knowledge. > > Cheers, > Simon. > > On 21 August 2017 at 23:49, Ricky Zhang <zha...@gm... <mailto:zha...@gm...>> wrote: > 1. Only virtual addressing a.k.a memory bank supports 24 bit mode. First of all, you need to confirm you are in 24bit mode. > > 2. I assume you use SDL, the virtual addressing mode divides memory into banks (RTFM https://github.com/cebix/macemu/wiki/Basilisk-II-Core-Emulation-Analysis#virtual-addressing <https://github.com/cebix/macemu/wiki/Basilisk-II-Core-Emulation-Analysis#virtual-addressing>) and assign corresponding RAM, ROM and frame buffer read/write function by map_bank function during initialization. > > 3. I’m not sure what frame layout you use, but if you check any frame buffer read/write function frame_host_xxx_xxx in src/uae_cpu/memory.cpp. The mapping only applies difference between MacFrameBaseHost and MacFrameBaseMac directly to guest Mac frame buffer address to get host frame buffer. > > 4. I’m not sure how Macintosh guest OS handles 0xa0000000 in 24 bit addressing. I hope someone can help us on this. > > 0530 <> void memory_init <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=memory_init>(void) > 0531 <> { > 0532 <> for(long i <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=i>=0; i <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=i><65536; i <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=i>++) > 0533 <> put_mem_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=put_mem_bank>(i <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=i><<16, &dummy_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=dummy_bank>); > 0534 <> > 0535 <> // Limit RAM size to not overlap ROM > 0536 <> uint32 <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=uint32> ram_size <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ram_size> = RAMSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=RAMSize> > ROMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMBaseMac> ? ROMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMBaseMac> : RAMSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=RAMSize>; > 0537 <> > 0538 <> RAMBaseDiff <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=RAMBaseDiff> = (uintptr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=uintptr>)RAMBaseHost <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=RAMBaseHost> - (uintptr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=uintptr>)RAMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=RAMBaseMac>; > 0539 <> ROMBaseDiff <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMBaseDiff> = (uintptr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=uintptr>)ROMBaseHost <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMBaseHost> - (uintptr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=uintptr>)ROMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMBaseMac>; > 0540 <> FrameBaseDiff <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=FrameBaseDiff> = (uintptr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=uintptr>)MacFrameBaseHost <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameBaseHost> - (uintptr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=uintptr>)MacFrameBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameBaseMac>; > 0541 <> > 0542 <> // Map RAM and ROM > 0543 <> if (TwentyFourBitAddressing <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=TwentyFourBitAddressing>) { > 0544 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&ram24_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ram24_bank>, RAMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=RAMBaseMac> >> 16, ram_size <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ram_size> >> 16); > 0545 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&rom24_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=rom24_bank>, ROMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMBaseMac> >> 16, ROMSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMSize> >> 16); > 0546 <> } else { > 0547 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&ram_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ram_bank>, RAMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=RAMBaseMac> >> 16, ram_size <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ram_size> >> 16); > 0548 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&rom_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=rom_bank>, ROMBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMBaseMac> >> 16, ROMSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=ROMSize> >> 16); > 0549 <> } > 0550 <> > 0551 <> // Map frame buffer > 0552 <> switch (MacFrameLayout <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameLayout>) { > 0553 <> case FLAYOUT_DIRECT <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=FLAYOUT_DIRECT>: > 0554 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&frame_direct_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=frame_direct_bank>, MacFrameBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameBaseMac> >> 16, (MacFrameSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameSize> >> 16) + 1); > 0555 <> break; > 0556 <> case FLAYOUT_HOST_555 <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=FLAYOUT_HOST_555>: > 0557 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&frame_host_555_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=frame_host_555_bank>, MacFrameBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameBaseMac> >> 16, (MacFrameSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameSize> >> 16) + 1); > 0558 <> break; > 0559 <> case FLAYOUT_HOST_565 <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=FLAYOUT_HOST_565>: > 0560 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&frame_host_565_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=frame_host_565_bank>, MacFrameBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameBaseMac> >> 16, (MacFrameSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameSize> >> 16) + 1); > 0561 <> break; > 0562 <> case FLAYOUT_HOST_888 <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=FLAYOUT_HOST_888>: > 0563 <> map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(&frame_host_888_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=frame_host_888_bank>, MacFrameBaseMac <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameBaseMac> >> 16, (MacFrameSize <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=MacFrameSize> >> 16) + 1); > 0564 <> break; > 0565 <> } > 0566 <> } > 0567 <> > 0568 <> void map_banks <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=map_banks>(addrbank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=addrbank> *bank, int start <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=start>, int size <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=size>) > 0569 <> { > 0570 <> int bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr>; > 0571 <> unsigned long int hioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=hioffs> = 0, endhioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=endhioffs> = 0x100; > 0572 <> > 0573 <> if (start <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=start> >= 0x100) { > 0574 <> for (bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr> = start <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=start>; bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr> < start <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=start> + size <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=size>; bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr>++) > 0575 <> put_mem_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=put_mem_bank> (bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr> << 16, bank); > 0576 <> return; > 0577 <> } > 0578 <> if (TwentyFourBitAddressing <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=TwentyFourBitAddressing>) endhioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=endhioffs> = 0x10000; > 0579 <> for (hioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=hioffs> = 0; hioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=hioffs> < endhioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=endhioffs>; hioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=hioffs> += 0x100) > 0580 <> for (bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr> = start <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=start>; bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr> < start <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=start>+size <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=size>; bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr>++) > 0581 <> put_mem_bank <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=put_mem_bank>((bnr <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=bnr> + hioffs <http://192.168.2.213/lxr/ident/bii?v=15Aug2017&_i=hioffs>) << 16, bank); > 0582 <> } > 0583 <> > 0584 <> #endif /* !REAL_ADDRESSING && !DIRECT_ADDRESSING */ > > >> On Aug 21, 2017, at 5:33 PM, Simon Frankau <sg...@ar... <mailto:sg...@ar...>> wrote: >> >> Hi. >> >> I'm trying to use Basilisk II to emulate a Mac Classic - I want to emulate a Mac running in 24-bit mode. My attempts to make it work using unpatched source didn't work. I'm not sure how it's intended to work, but I saw: >> >> const uint32 MacFrameBaseMac = 0xa0000000; >> >> in cpu_emulation.h. In 24-bit mode this aliases with 0x000000, and on the Classic the framebuffer is expected to live at 0x3fa700. >> >> Given this, I'm not sure how the display is expected to work in Basilisk II for a Classic or other 24-bit mode Macs. I've created a patch to make the Classic framebuffer work (and it boots up 6.0.8 ok). However, I wanted to check if I've missed something silly, and if there's just a flag I should be specifying to make it work. If not, what's the appropriate way to suggest a patch? >> >> Thanks, >> Simon. >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org <http://slashdot.org/>! http://sdm.link/slashdot_______________________________________________ <http://sdm.link/slashdot_______________________________________________> >> basilisk-devel mailing list >> bas...@li... <mailto:bas...@li...> >> https://lists.sourceforge.net/lists/listinfo/basilisk-devel <https://lists.sourceforge.net/lists/listinfo/basilisk-devel> > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot <http://sdm.link/slashdot> > _______________________________________________ > basilisk-devel mailing list > bas...@li... <mailto:bas...@li...> > https://lists.sourceforge.net/lists/listinfo/basilisk-devel <https://lists.sourceforge.net/lists/listinfo/basilisk-devel> > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ > basilisk-devel mailing list > bas...@li... > https://lists.sourceforge.net/lists/listinfo/basilisk-devel |