Login  •  Register


The time is now: Thu Nov 21, 2019 12:53 am

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 13 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Sat Apr 21, 2018 12:00 am 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
I am trying to create my own emulator, but I'm not sure which library would best suit my purposes. I'm slightly tempted toward Allegro, but that doesn't fit my compiler like a glove to put it mildly. I'm using MinGW / gcc 5.1.0, if that helps any.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sat Apr 21, 2018 11:38 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2723
Location: Emaculation.com
I'd recommend basing on libretro. Then you get all the benefits of any future work done on that architecture.

What sort of emulation are you planning to do though? The libraries you use will mostly depend on that.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Apr 22, 2018 9:02 pm 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
LibRetro isn't bad, but I'm not sure if doing that before I even begin coding the emulator proper is a great idea. Especially given that what I'm doing is a computer (specifically, a PowerPC machine).


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Apr 23, 2018 3:38 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2723
Location: Emaculation.com
Basically, I think it's a good idea to figure out what you don't want/need to emulate as well as what you want to. Unlesss your question was actually simpler than that.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Nov 18, 2018 4:38 pm 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
So far I'm sticking with SDL2. I'm slowly trying to build up this emulator and collecting all the development materials I can. Needless to say, it's going a little rocky so far. If anyone wants to see the progress so far, there is a Discord server set up.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Nov 18, 2018 8:30 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2723
Location: Emaculation.com
Sounds good! Might want to look at what was done for MAME and LibRetro for ideas of what you want and don't want as far as structure and design.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Dec 18, 2018 3:56 am 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
So, I have started on the emulator booting up the Power Mac G3 Beige ROM. But it quickly dies at 0xFFF321C after 149 opcodes, starting at 0xFFF00100.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Jan 14, 2019 5:59 am 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
Well, I fixed a major code execution error, but now I'm trapped in an infinite loop after branching to a routine at 0xfff05bc4 (0x305BC4 in the ROM), which then unexpectedly goes to the loop at 0xfff05BE0 (0x305BE0 in the ROM).


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Jan 14, 2019 8:12 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2723
Location: Emaculation.com
0x305BE0 sounds really familiar, but is obscured by 20 years of neglect. Google's being no help :\


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri May 17, 2019 3:10 am 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
In the previous post, I was stuck in the routine referenced by 0xfff03024.

Some bugfixes later and now I'm almost halfway through the check-up routines in 0xfff03000. It currently malfunctions at 0xfff03044 (function address: 0xfff03778), where it calls a previous functions and gets stuck there in an infinite loop at 0xfff056a4.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed May 29, 2019 5:12 am 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
It currently stops out at 0xfff0304c. So roughly halfway through the initialization routine. But there seems to be some weird memory allocation issues I'm trying to track down in the ROM.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed May 29, 2019 4:13 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2723
Location: Emaculation.com
You've got further than I ever did now. Does the ROM chain memory allocation from the original ROM area to the larger ROM area, or just patch to the larger area right from initial allocation?

Paul Pratt might be able to help you there, as Mini vMac just patches it wholesale.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Jun 27, 2019 3:33 am 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
Some technical notes I have gathered so far, with help from the cdg5 mailing group.

Code:
VIRTUAL MEMORY MAP

5FFFEFF0 - NKSystemInfo
68000000 - Motorola 68K Emulator (0x100000 bytes)
FF800000 - Open Firmware

PHYSICAL MEMORY MAP

00000000 - 7FFFFFFF
    Mac OS Main Memory

    00400000 - OpenFirmware
    40000000 - Mirror of the ROM (NuBus Macs)
 
80000000 - FF000000
    PCI/Device Memory Area
 
81000000 - ATI MACH 64
 
F3000000 -
    Mac OS I/O Device area

F3000030 - MIO Register (0x10 bytes)

F3008000 - F3008FFF - DMA Channels

    F3008000 - SCSI DMA
    F3008100 - Floppy DMA
    F3008200 - Ethernet transmit DMA
    F3008300 - Ethernet receive DMA
    F3008400 - SCC channel A transmit DMA
    F3008500 - SCC channel A receive DMA
    F3008600 - SCC channel B transmit DMA
    F3008700 - SCC channel B receive DMA
    F3008800 - Audio out DMA
    F3008900 - Audio in DMA
    F3009000 - Reserved (0x7000 bytes)

F3010000 - SCSI device registers (0x100 bytes)
F3011000 - MACE (serial) device registers (0x100 bytes)
F3012000 - SCC compatibility port (?) (0x100 bytes)
F3013000 - SCC MacRISC port (Serial for 0x20, then Modem for 0x20, with remaining 0xC0 unknown)
F3014000 - AWAC (Audio) chip device registers
F3015000 - SWIM3 (floppy controller) device registers
F3016000 - pseudo VIA1 device registers
F3017000 - pseudo VIA2 device registers

F3020000 - Heathrow ATA

F3040000 - F037FFFF - Open PIC

F8000000 - Hammerhead memory controller registers (0x1000000 bytes)

FE010000 - 53C875 Hard Drive Controller

FE000000 - Grackle Low/Base (0x10000 bytes)
FEC00000 - Grackle Middle (0x1000 bytes)
FEE00000 - Grackle High (0x1000 bytes)

FF000000 - ?

FFC00000 - FFFFFFFF
    Mac OS ROM Area

    FFC00000 - FFEFFFFF - 68k Code Area

    (below addresses apply to Old World ROMs)
    FFF00100 - Reset Area (where the ROM begins executing)
    FFF10000 - Nanokernel Code
    FFF20000 - HW Init


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 13 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group