OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 5475|回复: 2

STM32F429 Sega Master System Emulator

[复制链接]

11

主题

52

帖子

0

精华

初级会员

Rank: 2

积分
135
金钱
135
注册时间
2012-6-1
在线时间
3 小时
发表于 2014-10-21 00:05:14 | 显示全部楼层 |阅读模式




On this page you will get the Source code for emulate a Sega Master System with my VGA expansion board.
The original work for the st429 Discovery board is from Alessandro Rocchegiani.
You can watch his video here :
STM32F429 Discovery Sega Master System Emulator

I want to thank Alessandro and his Son Fabrizio for all the help they provided for adapt this emulator on my library.
You will see the result here :
stm32f429 discovery board running Sega Master System Emulator in VGA screen
A big update to the Emulator today the : 2014 02 09:
First of all i finally found what have made the Emulator 2 x slower than the normal speed.
It was the Wii controller driver.
Because I2C need some delay between send/receive , at each screen we loose allot of time.
So i decided to remove the Wii from here and use now the TM1638 driver , SPI is so fast that you
don't see any breaking when you are playing.
Only bad thing is that i don't have joystick that work with SPI actually
Alessandro use buttons connected to free pins from the disco board , and i use the Spectrum
keyboard i just made for the other emulator to play with the SMS games , not really effective
but good for intensive testing.
Alessandro helped allot here for the use of the 4 x SMS screen resolution , don't forget that we
use 640 x 480 pixels here and it take lot's of time.
And now everything run smooth , i see that some games like R-Type have sometimes graphical bugs.
But for a beta version we have to agree that it run well

Now more information about the key used from the Spectrum keyboard.

At the starting menu you can choose the game you want run.
the key's are :
Up = 1
Down = Q
Select = Enter

In-game key to use :
UP = S
DOWN = Z
LEFT = Caps Shift
RIGHT = X
FIRE 1 = Symbol Shift
FIRE 2 = Break Space

For select another game use :
RESET

This will stop the actual game , open the Selector Menu , and let you choose the next game to play.

Now for use other SMS ROM Images don't forget to modify :

#define NUM_CARTRIDGE 6                   <-- you need to put the exact number of Game ROM you put on the SD Card

Next is just to edit this variable ,
the 1st value (0x0F for example) is the number of 16k bank that the ROM contain.
0x00 (0) to 0x0F(15) = 16 (0 is included !!)
Then for the 0x0F Value the ROM is a 16 x 16k = 256k ROM
the next value :
"Sonic the Hedgehog '91" is what you will see on the Selector menu
Then come the :
"0:/sms/Sonic.sms" it's where you have put the ROM into the SD Card
Don't forget that we use the 8.3 format (8 Character for name and 3 Character for extension)

// Place the ROM into SDRAM 2 after the Display buffers
ROMS Cartridge[NUM_CARTRIDGE]={
    //     0123456789012345678901
    {0x0f,"Sonic the Hedgehog '91","0:/sms/Sonic.sms"},
    {0x0f,"Castle of Illusion '90","0:/sms/Castle.sms"},
    {0x0f,"    Psycho Fox '89    ","0:/sms/Psycho.sms"},
    {0x1f,"  The Lion King  '94  ","0:/sms/Lion.sms"},
    {0x1f,"        R-Type        ","0:/sms/RType.sms"},
    {0x1f," D. Duck in Hollywood ","0:/sms/Daffy.sms"}
};

You have just to recompile and play your games ;)

News from 2014-02-25:
I improved the way i read the SDCard , before it was bytes per bytes , now i use a fixed address to SDRAM for not have to specify them in the Load function and
the File are read with 512 bytes block , it have improve the stability on reading and i doesn't get any read error up to now.

At bottom from the page , the latest source code.

SMS_EMU_VGA.rar

3.22 MB, 下载次数: 488

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165309
金钱
165309
注册时间
2010-12-1
在线时间
2108 小时
发表于 2014-10-21 01:28:34 | 显示全部楼层
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

4

主题

19

帖子

0

精华

初级会员

Rank: 2

积分
85
金钱
85
注册时间
2014-6-15
在线时间
5 小时
发表于 2014-10-21 22:09:27 | 显示全部楼层
棒!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-23 04:45

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表