Gabriel Honoré<br />1<br />
What is it?<br />A collection of software emulators<br />A software emulator is a computerprogram that imitates an electro...
What is it?<br />1º - A Commodore 64emulator<br />3<br />
What is it?<br />2º - A NintendoEntertainmentSystem (NES) emulator<br />4<br />
Whatisit?<br />3º - A set of abstractions,components, and toolsthat can behelpfulformakingotheremulators(WIP)<br />FRAMEWO...
Short demo<br />6<br />
Motivations<br />I noticed that:<br />People always choose statically-typedlanguages for making them.<br />Proceduraldesig...
Goals<br />Whatdid I wanttoaccomplish?<br />Writeeverything in Smalltalk! .<br />OO design first, then think about perfor...
How are theemulatorsmade?<br />9<br />
Thesystementities<br />A common C64 system has:<br />10<br />
Theusersideentities<br />Theuserwantstointeractwiththeemulatedsystemthrough:<br />11<br />
Groups of entities<br />Objectsfor<br />translation<br />User’s IO<br />devices<br />Thesystementities<br />12<br />
Groups of entities<br />Thesystemmodel<br />Theuser’s IO devices<br />Theobjectsthatallowcommunicationbetweenthetwoworlds<...
Thesystemmodel<br />POWER<br />SUPPLY<br />PERIPHERALS<br />MAIN UNIT<br />SOFTWARE<br />MEDIA<br />14<br />
Thesystemmodel<br />Thepowersupply<br />Implementsthe concept of “keepingalive”electricaldevices<br />Works at a specified...
Thesystemmodel<br />Themainunit<br />16<br />
Thesystemmodel<br />The C64 architecture<br />(simplified)<br />CPU<br />(MOS 6510)<br />Address<br />decoder<br />IO CHIP...
Thesystemmodel<br />The NES architecture<br />(simplified)<br />CPU<br />(MOS 6502)<br />Address<br />decoder<br />Color p...
Thesystemmodel<br />How do the machines work?<br />The CPU isclockedbythepowersupply<br />The CPU readsfrom and writestoth...
Thesystemmodel<br />Theperipherals:<br />20<br />
Thesystemmodel<br />The media<br />21<br />
The Video system<br />RETROBJECTS<br />SIDE<br />DEVELOPER ONLYNEEDS TO IMPLEMENT<br />THESE TWO OBJECTS<br />Palette<br /...
The Audio system<br />RETROBJECTS SIDE<br />Buffer<br />Strategy<br />Thesystemmodel<br />External<br />interface<br />Pow...
The Input system<br />OUTSIDE RETROBJECTS<br />RETROBJECTS<br />Thesystemmodel<br />Representation<br />of user’s<br />key...
Groups of entities<br />Thesystemmodel<br />Theuser’s IO devices<br />Theobjectsthatallowcommunicationbetweenthetwoworlds<...
Theuser’s IO devices<br />External interfaces:<br />FMODEx<br />SDL & xffd<br />SDL &<br />OpenGL<br />Files<br />26<br />
Groups of entities<br />Thesystemmodel<br />Theuser’s IO devices<br />Theobjectsthatallowcommunicationbetweenthetwo “world...
Translationobjects<br />Loaders<br />Take a file and convertsitintothe actualsoftware media, ie: T64, PRG, TAP.<br />Adapt...
There are lots of thingsthatcouldbereusedonotheremulators!<br />29<br />
Theframework<br />Someabstractions:<br />Devices<br />I/O chips<br />Sound chips<br />Video chips<br />Schedulingprocess<b...
The framework<br />Somecomponents:<br />TV, speaker, powersupply<br />Digital pins, one-way and bi-directionalports<br />A...
Theframework<br />Tools:<br />Notmany so far<br />Goal:<br />More interactivedevelopment,doinglessprogramming.<br />32<br />
Conclusions<br />Smalltalk can do that, too! <br />The Smalltalk environment is idealfor modeling hardware.<br />Profilin...
Future works<br />Make it cross-platform<br />Make it run in Mac & Linux<br />Keepimprovingtheemulators.<br />Keepevolving...
Questions?<br />35<br />
THANK YOU!<br />Gabriel Honoré<br />ghonore@gmail.com<br />http://www.zeek-it.com.ar/retrobjects/<br />36<br />
Upcoming SlideShare
Loading in …5
×

Retrobjects - Fun with C64 and NES

1,308 views

Published on

Retrobjects - Fun with C64 and NES by Gabriel E. Honoré, ESUG09, Brest, France

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,308
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Retrobjects - Fun with C64 and NES

  1. 1. Gabriel Honoré<br />1<br />
  2. 2. What is it?<br />A collection of software emulators<br />A software emulator is a computerprogram that imitates an electronicdevice or another program.<br />Examples:<br />DOSBox<br />MAME<br />2<br />
  3. 3. What is it?<br />1º - A Commodore 64emulator<br />3<br />
  4. 4. What is it?<br />2º - A NintendoEntertainmentSystem (NES) emulator<br />4<br />
  5. 5. Whatisit?<br />3º - A set of abstractions,components, and toolsthat can behelpfulformakingotheremulators(WIP)<br />FRAMEWORK<br />…<br />…<br />?<br />5<br />
  6. 6. Short demo<br />6<br />
  7. 7. Motivations<br />I noticed that:<br />People always choose statically-typedlanguages for making them.<br />Proceduraldesigns are preferedwhencomparedtoobject-orienteddesigns.<br />Whyisthat?<br />Performance issues.<br />Isthatreally a problemnowadays?<br />7<br />
  8. 8. Goals<br />Whatdid I wanttoaccomplish?<br />Writeeverything in Smalltalk! .<br />OO design first, then think about performance.<br />Recreatethefeeling of the original machines<br />Highqualityemulation.<br />Createaneasyto useframeworkforwritingcomputer & gameconsoleemulators<br />8<br />
  9. 9. How are theemulatorsmade?<br />9<br />
  10. 10. Thesystementities<br />A common C64 system has:<br />10<br />
  11. 11. Theusersideentities<br />Theuserwantstointeractwiththeemulatedsystemthrough:<br />11<br />
  12. 12. Groups of entities<br />Objectsfor<br />translation<br />User’s IO<br />devices<br />Thesystementities<br />12<br />
  13. 13. Groups of entities<br />Thesystemmodel<br />Theuser’s IO devices<br />Theobjectsthatallowcommunicationbetweenthetwoworlds<br />13<br />
  14. 14. Thesystemmodel<br />POWER<br />SUPPLY<br />PERIPHERALS<br />MAIN UNIT<br />SOFTWARE<br />MEDIA<br />14<br />
  15. 15. Thesystemmodel<br />Thepowersupply<br />Implementsthe concept of “keepingalive”electricaldevices<br />Works at a specifiedfrequency<br />Manydevices can bepluggedtoit<br />It’simplementedwith aSmalltalkprocess<br />15<br />
  16. 16. Thesystemmodel<br />Themainunit<br />16<br />
  17. 17. Thesystemmodel<br />The C64 architecture<br />(simplified)<br />CPU<br />(MOS 6510)<br />Address<br />decoder<br />IO CHIPS<br />MEMORIES<br />Video chip<br />MOS 6569<br />R<br />E<br />G<br />Mainmemory<br />(64K RAM)<br />Color (?K RAM)<br />Sound chip<br />MOS 6581<br />R<br />E<br />G<br />Basic (?K ROM)<br />R<br />E<br />G<br />Kernal (?K ROM)<br />CIA 1<br />Char (?K ROM)<br />R<br />E<br />G<br />CIA 2<br />17<br />
  18. 18. Thesystemmodel<br />The NES architecture<br />(simplified)<br />CPU<br />(MOS 6502)<br />Address<br />decoder<br />Color palette<br />(32 bytes RAM)<br />IO CHIPS<br />MEMORIES<br />Video chip<br />PPU<br />R<br />E<br />G<br />Characterinternalmemory (2K RAM)<br />Memoryprovided<br />bythecartridge<br />Sound chip<br />APU<br />R<br />E<br />G<br />R<br />E<br />G<br />Sprite RAM<br />(256 bytes)<br />DMA<br />R<br />E<br />G<br />IO<br />18<br />
  19. 19. Thesystemmodel<br />How do the machines work?<br />The CPU isclockedbythepowersupply<br />The CPU readsfrom and writestothe bus<br />ie: at:anAddressput:aNumber<br />Addressdecoder: Addressinterval -&gt; Chip<br />(16r0000-16r7FFF) -&gt; RAM (0000-7FFF)<br />(16r8000-16r800F) -&gt; Video chip (0000-000F)<br />Theselected chip getstherequest,and theregisters interface mapitintoanaction.<br />19<br />
  20. 20. Thesystemmodel<br />Theperipherals:<br />20<br />
  21. 21. Thesystemmodel<br />The media<br />21<br />
  22. 22. The Video system<br />RETROBJECTS<br />SIDE<br />DEVELOPER ONLYNEEDS TO IMPLEMENT<br />THESE TWO OBJECTS<br />Palette<br />Thesystemmodel<br />Powersource<br />Video<br />chip<br />Frame<br />buffer<br />Color<br />generator<br />External<br />interface<br />TV<br />Converter<br />22<br />
  23. 23. The Audio system<br />RETROBJECTS SIDE<br />Buffer<br />Strategy<br />Thesystemmodel<br />External<br />interface<br />Power<br />source<br />Sound<br />chip<br />Sampler<br />Speaker<br />DEVELOPER ONLYNEEDS TO IMPLEMENT<br />THIS OBJECT<br />23<br />
  24. 24. The Input system<br />OUTSIDE RETROBJECTS<br />RETROBJECTS<br />Thesystemmodel<br />Representation<br />of user’s<br />keyboard<br />User presses<br />The ‘A’ key<br />External<br />interface<br />C64<br />keyboard<br />Adaptor<br />DEVELOPER ONLYNEEDS TO IMPLEMENT<br />THESE TWO OBJECTS<br />24<br />
  25. 25. Groups of entities<br />Thesystemmodel<br />Theuser’s IO devices<br />Theobjectsthatallowcommunicationbetweenthetwoworlds<br />25<br />
  26. 26. Theuser’s IO devices<br />External interfaces:<br />FMODEx<br />SDL & xffd<br />SDL &<br />OpenGL<br />Files<br />26<br />
  27. 27. Groups of entities<br />Thesystemmodel<br />Theuser’s IO devices<br />Theobjectsthatallowcommunicationbetweenthetwo “worlds”<br />27<br />
  28. 28. Translationobjects<br />Loaders<br />Take a file and convertsitintothe actualsoftware media, ie: T64, PRG, TAP.<br />Adaptors<br />Take a user input event and convertsitintoanaction in themodel.<br />ie: User’skeypress -&gt; C64 keypress<br />TheGUIs<br />28<br />
  29. 29. There are lots of thingsthatcouldbereusedonotheremulators!<br />29<br />
  30. 30. Theframework<br />Someabstractions:<br />Devices<br />I/O chips<br />Sound chips<br />Video chips<br />Schedulingprocess<br />30<br />
  31. 31. The framework<br />Somecomponents:<br />TV, speaker, powersupply<br />Digital pins, one-way and bi-directionalports<br />Addressdecoders: mapping, bank-switching,mirroring<br />Memories: RAM, ROM and registers<br />Stroberegisters<br />Counters and comparators<br />Buttons and switches<br />Video filters, samplers, etc.<br />31<br />
  32. 32. Theframework<br />Tools:<br />Notmany so far<br />Goal:<br />More interactivedevelopment,doinglessprogramming.<br />32<br />
  33. 33. Conclusions<br />Smalltalk can do that, too! <br />The Smalltalk environment is idealfor modeling hardware.<br />Profiling is the key for getting greatperformance without compromisingthe design.<br />33<br />
  34. 34. Future works<br />Make it cross-platform<br />Make it run in Mac & Linux<br />Keepimprovingtheemulators.<br />Keepevolvingtheframework.<br />Documentation, please!<br />No tests <br />Make more emulators!<br />34<br />
  35. 35. Questions?<br />35<br />
  36. 36. THANK YOU!<br />Gabriel Honoré<br />ghonore@gmail.com<br />http://www.zeek-it.com.ar/retrobjects/<br />36<br />

×