Download
slide1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Gabriel Honoré PowerPoint Presentation
Download Presentation
Gabriel Honoré

Gabriel Honoré

83 Views Download Presentation
Download Presentation

Gabriel Honoré

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Gabriel Honoré

  2. What is it? • A collection of software emulators • A software emulator is a computerprogram that imitates an electronicdevice or another program. • Examples: • DOSBox • MAME

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

  4. What is it? • 2º - A NintendoEntertainmentSystem (NES) emulator

  5. Whatisit? • 3º - A set of abstractions,components, and toolsthat can behelpfulformakingotheremulators(WIP) FRAMEWORK … … ?

  6. Short demo

  7. Motivations • I noticed that: • People always choose statically-typedlanguages for making them. • Proceduraldesigns are preferedwhencomparedtoobject-orienteddesigns. • Whyisthat? • Performance issues. • Isthatreally a problemnowadays?

  8. Goals • Whatdid I wanttoaccomplish? • Writeeverything in Smalltalk! . • OO design first, then think about performance. • Recreatethefeeling of the original machines • Highqualityemulation. • Createaneasyto useframeworkforwritingcomputer & gameconsoleemulators

  9. How are theemulatorsmade?

  10. Thesystementities • A common C64 system has:

  11. Theusersideentities • Theuserwantstointeractwiththeemulatedsystemthrough:

  12. Groups of entities Objectsfor translation User’s IO devices Thesystementities

  13. Groups of entities • Thesystemmodel • Theuser’s IO devices • Theobjectsthatallowcommunicationbetweenthetwoworlds

  14. Thesystemmodel POWER SUPPLY PERIPHERALS MAIN UNIT SOFTWARE MEDIA

  15. Thesystemmodel • Thepowersupply • Implementsthe concept of “keepingalive”electricaldevices • Works at a specifiedfrequency • Manydevices can bepluggedtoit • It’simplementedwith aSmalltalkprocess

  16. Thesystemmodel • Themainunit

  17. Thesystemmodel The C64 architecture (simplified) CPU (MOS 6510) Address decoder IO CHIPS MEMORIES Video chip MOS 6569 R E G Mainmemory (64K RAM) Color (?K RAM) Sound chip MOS 6581 R E G Basic (?K ROM) R E G Kernal (?K ROM) CIA 1 Char (?K ROM) R E G CIA 2

  18. Thesystemmodel The NES architecture (simplified) CPU (MOS 6502) Address decoder Color palette (32 bytes RAM) IO CHIPS MEMORIES Video chip PPU R E G Characterinternalmemory (2K RAM) Memoryprovided bythecartridge Sound chip APU R E G R E G Sprite RAM (256 bytes) DMA R E G IO

  19. Thesystemmodel • How do the machines work? • The CPU isclockedbythepowersupply • The CPU readsfrom and writestothe bus • ie: at:anAddressput:aNumber • Addressdecoder: Addressinterval -> Chip • (16r0000-16r7FFF) -> RAM (0000-7FFF) • (16r8000-16r800F) -> Video chip (0000-000F) • Theselected chip getstherequest,and theregisters interface mapitintoanaction.

  20. Thesystemmodel • Theperipherals:

  21. Thesystemmodel • The media

  22. Thesystemmodel The Video system DEVELOPER ONLYNEEDS TO IMPLEMENT THESE TWO OBJECTS RETROBJECTS SIDE Palette Powersource Video chip Frame buffer Color generator External interface TV Converter

  23. Thesystemmodel The Audio system RETROBJECTS SIDE Buffer Strategy Power source External interface Sound chip Sampler Speaker DEVELOPER ONLYNEEDS TO IMPLEMENT THIS OBJECT

  24. Thesystemmodel The Input system OUTSIDE RETROBJECTS RETROBJECTS Representation of user’s keyboard User presses The ‘A’ key External interface C64 keyboard Adaptor DEVELOPER ONLYNEEDS TO IMPLEMENT THESE TWO OBJECTS

  25. Groups of entities • Thesystemmodel • Theuser’s IO devices • Theobjectsthatallowcommunicationbetweenthetwoworlds

  26. Theuser’s IO devices • External interfaces: FMODEx SDL & xffd SDL & OpenGL Files

  27. Groups of entities • Thesystemmodel • Theuser’s IO devices • Theobjectsthatallowcommunicationbetweenthetwo “worlds”

  28. Translationobjects • Loaders • Take a file and convertsitintothe actualsoftware media, ie: T64, PRG, TAP. • Adaptors • Take a user input event and convertsitintoanaction in themodel. • ie: User’skeypress -> C64 keypress • TheGUIs

  29. There are lots of thingsthatcouldbereusedonotheremulators!

  30. Theframework • Someabstractions: • Devices • I/O chips • Sound chips • Video chips • Schedulingprocess

  31. The framework • Somecomponents: • TV, speaker, powersupply • Digital pins, one-way and bi-directionalports • Addressdecoders: mapping, bank-switching,mirroring • Memories: RAM, ROM and registers • Stroberegisters • Counters and comparators • Buttons and switches • Video filters, samplers, etc.

  32. Theframework • Tools: • Notmany so far • Goal: • More interactivedevelopment,doinglessprogramming.

  33. Conclusions • Smalltalk can do that, too!  • The Smalltalk environment is idealfor modeling hardware. • Profiling is the key for getting greatperformance without compromisingthe design.

  34. Future works • Make it cross-platform • Make it run in Mac & Linux • Keepimprovingtheemulators. • Keepevolvingtheframework. • Documentation, please! • No tests  • Make more emulators!

  35. Questions?

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