Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gabriel Honoré 1. What is it? A collection of software emulators –A software emulator is a computer program that imitates an electronic device or another.

Similar presentations


Presentation on theme: "Gabriel Honoré 1. What is it? A collection of software emulators –A software emulator is a computer program that imitates an electronic device or another."— Presentation transcript:

1 Gabriel Honoré 1

2 What is it? A collection of software emulators –A software emulator is a computer program that imitates an electronic device or another program. Examples: –DOSBox –MAME 2

3 What is it? 1º - A Commodore 64 emulator 3

4 What is it? 2º - A Nintendo Entertainment System (NES) emulator 4

5 What is it? 3º - A set of abstractions, components, and tools that can be helpful for making other emulators (WIP) ? … FRAMEWORK … 5

6 Short demo 6

7 Motivations I noticed that: –People always choose statically-typed languages for making them. –Procedural designs are prefered when compared to object-oriented designs. Why is that? –Performance issues. Is that really a problem nowadays? 7

8 Goals What did I want to accomplish? –Write everything in Smalltalk!. –OO design first, then think about performance. –Recreate the feeling of the original machines –High quality emulation. –Create an easy to use framework for writing computer & game console emulators 8

9 How are the emulators made? 9

10 The system entities A common C64 system has: 10

11 The user side entities The user wants to interact with the emulated system through: 11

12 Groups of entities Users IO devices The system entities Objects for translation 12

13 Groups of entities The system model The users IO devices The objects that allow communication between the two worlds 13

14 The system model POWER SUPPLY PERIPHERALS SOFTWARE MEDIA MAIN UNIT 14

15 The system model The power supply –Implements the concept of keeping alive electrical devices –Works at a specified frequency –Many devices can be plugged to it –Its implemented with a Smalltalk process 15

16 The system model The main unit 16

17 The system model CPU (MOS 6510) CPU (MOS 6510) Video chip MOS 6569 Video chip MOS 6569 Sound chip MOS 6581 Sound chip MOS 6581 CIA 1 CIA 2 Main memory (64K RAM) Main memory (64K RAM) Basic (?K ROM) Kernal (?K ROM) Char (?K ROM) Color (?K RAM) MEMORIES IO CHIPS REGREG REGREG REGREG REGREG REGREG REGREG REGREG REGREG Address decoder Address decoder The C64 architecture (simplified) 17

18 The system model CPU (MOS 6502) CPU (MOS 6502) Video chip PPU Video chip PPU Sound chip APU Sound chip APU DMA IO Character internal memory (2K RAM) Memory provided by the cartridge Memory provided by the cartridge MEMORIES IO CHIPS REGREG REGREG REGREG REGREG REGREG REGREG REGREG REGREG Address decoder Address decoder Color palette (32 bytes RAM) Color palette (32 bytes RAM) Sprite RAM (256 bytes) Sprite RAM (256 bytes) The NES architecture (simplified) 18

19 The system model How do the machines work? The CPU is clocked by the power supply The CPU reads from and writes to the bus –ie: at: anAddress put: aNumber Address decoder: Address interval -> Chip –(16r0000-16r7FFF) -> RAM (0000-7FFF) –(16r8000-16r800F) -> Video chip (0000-000F) The selected chip gets the request, and the registers interface map it into an action. 19

20 The system model The peripherals: 20

21 The system model The media 21

22 The system model Power source Video chip Frame buffer Color generator Palette Converter TV External interface RETROBJECTS SIDE DEVELOPER ONLY NEEDS TO IMPLEMENT THESE TWO OBJECTS The Video system 22

23 The system model Sampler Sound chip Speaker External interface Buffer Strategy Power source RETROBJECTS SIDE DEVELOPER ONLY NEEDS TO IMPLEMENT THIS OBJECT The Audio system 23

24 The system model User presses The A key External interface Representation of users keyboard Adaptor C64 keyboard OUTSIDE RETROBJECTS RETROBJECTS DEVELOPER ONLY NEEDS TO IMPLEMENT THESE TWO OBJECTS The Input system 24

25 Groups of entities The system model The users IO devices The objects that allow communication between the two worlds 25

26 The users IO devices External interfaces: FMODEx SDL & OpenGL SDL & xffd Files 26

27 Groups of entities The system model The users IO devices The objects that allow communication between the two worlds 27

28 Translation objects Loaders –Take a file and converts it into the actual software media, ie: T64, PRG, TAP. Adaptors –Take a user input event and converts it into an action in the model. ie: Users keypress -> C64 keypress The GUIs 28

29 There are lots of things that could be reused on other emulators! 29

30 The framework Some abstractions: –Devices –I/O chips Sound chips Video chips –Scheduling process 30

31 The framework Some components: –TV, speaker, power supply –Digital pins, one-way and bi-directional ports –Address decoders: mapping, bank-switching, mirroring –Memories: RAM, ROM and registers –Strobe registers –Counters and comparators –Buttons and switches –Video filters, samplers, etc. 31

32 The framework Tools: –Not many so far –Goal: More interactive development, doing less programming. 32

33 Conclusions Smalltalk can do that, too! The Smalltalk environment is ideal for modeling hardware. Profiling is the key for getting great performance without compromising the design. 33

34 Future works Make it cross-platform –Make it run in Mac & Linux Keep improving the emulators. Keep evolving the framework. –Documentation, please! –No tests Make more emulators! 34

35 Questions? 35

36 THANK YOU! Gabriel Honoré ghonore@gmail.com http://www.zeek-it.com.ar/retrobjects/ 36


Download ppt "Gabriel Honoré 1. What is it? A collection of software emulators –A software emulator is a computer program that imitates an electronic device or another."

Similar presentations


Ads by Google