Skip to content
/ php-m68k Public

A PHP extension to emulate Motorola M68000 using Musashi's library

License

Notifications You must be signed in to change notification settings

carp3/php-m68k

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Motorola M68000 PHP Emulator extension

A simple wrapper for Musashi's M68K Emulator library


Requirements

  • PHP 8.x

Installation

phpize
./configure
make
make test
make install

Add the following line to your php.ini

extension=m68k.so

Docs

Please refer to Musashi's README file.

Extra Functions

You need to register your memory call backs. you must call these methods BEFORE calling m68k_pulse_reset or m68k_execute

Example:

    m68k_init();
    
    
    m68k_set_read_memory_8_callback('read8');
    m68k_set_read_memory_16_callback('read16');
    m68k_set_read_memory_32_callback('read32');


    m68k_set_write_memory_8_callback('write8');
    m68k_set_write_memory_16_callback('write16');
    m68k_set_write_memory_32_callback('write32');
    
    
    m68k_pulse_reset();
    m68k_execute(100);
    

    function read16(int $address) :int
    {
        ...
        return $value;
    }

    function read32(int $address) :int
    {
        ...
        return $value;
    }

    function read8(int $address) :int
    {
        ...
        return $value;
    }

    function write16(int $address, int $value)
    {
        ...
    }

    function write32(int $address,int $value)
    {
        ...
    }

    function write8(int $address, int $value)
    {
        ...
    }
    

About

A PHP extension to emulate Motorola M68000 using Musashi's library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages