Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carp3/php-m68k
A PHP extension to emulate Motorola M68000 using Musashi's library
https://github.com/carp3/php-m68k
Last synced: 9 days ago
JSON representation
A PHP extension to emulate Motorola M68000 using Musashi's library
- Host: GitHub
- URL: https://github.com/carp3/php-m68k
- Owner: carp3
- License: mit
- Created: 2022-10-14T15:20:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-14T19:51:35.000Z (over 2 years ago)
- Last Synced: 2024-11-16T10:18:16.763Z (2 months ago)
- Language: C
- Size: 183 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 installAdd the following line to your `php.ini`
extension=m68k.so
## Docs
Please refer to [Musashi's README file](https://github.com/kstenerud/Musashi).
## Extra FunctionsYou need to register your memory call backs. you must call these methods BEFORE calling `m68k_pulse_reset` or `m68k_execute`
Example:
```php
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)
{
...
}
```