SlideShare uma empresa Scribd logo
1 de 36
Gabriel Honoré 1
What is it? A collection of software emulators A software emulator is a computerprogram that imitates an electronicdevice or another program. Examples: DOSBox MAME 2
What is it? 1º - A Commodore 64emulator 3
What is it? 2º - A NintendoEntertainmentSystem (NES) emulator 4
Whatisit? 3º - A set of abstractions,components, and toolsthat can behelpfulformakingotheremulators(WIP) FRAMEWORK … … ? 5
Short demo 6
Motivations I noticed that: People always choose statically-typedlanguages for making them. Proceduraldesigns are preferedwhencomparedtoobject-orienteddesigns. Whyisthat? Performance issues. Isthatreally a problemnowadays? 7
Goals Whatdid I wanttoaccomplish? Writeeverything in Smalltalk! . OO design first, then think about performance. Recreatethefeeling of the original machines Highqualityemulation. Createaneasyto useframeworkforwritingcomputer & gameconsoleemulators 8
How are theemulatorsmade? 9
Thesystementities A common C64 system has: 10
Theusersideentities Theuserwantstointeractwiththeemulatedsystemthrough: 11
Groups of entities Objectsfor translation User’s IO devices Thesystementities 12
Groups of entities Thesystemmodel Theuser’s IO devices Theobjectsthatallowcommunicationbetweenthetwoworlds 13
Thesystemmodel POWER SUPPLY PERIPHERALS MAIN UNIT SOFTWARE MEDIA 14
Thesystemmodel Thepowersupply Implementsthe concept of “keepingalive”electricaldevices Works at a specifiedfrequency Manydevices can bepluggedtoit It’simplementedwith aSmalltalkprocess 15
Thesystemmodel Themainunit 16
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 17
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 18
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. 19
Thesystemmodel Theperipherals: 20
Thesystemmodel The media 21
The Video system RETROBJECTS SIDE DEVELOPER ONLYNEEDS TO IMPLEMENT THESE TWO OBJECTS Palette Thesystemmodel Powersource Video chip Frame buffer Color generator External interface TV Converter 22
The Audio system RETROBJECTS SIDE Buffer Strategy Thesystemmodel External interface Power source Sound chip Sampler Speaker DEVELOPER ONLYNEEDS TO IMPLEMENT THIS OBJECT 23
The Input system OUTSIDE RETROBJECTS RETROBJECTS Thesystemmodel Representation of user’s keyboard User presses The ‘A’ key External interface C64 keyboard Adaptor DEVELOPER ONLYNEEDS TO IMPLEMENT THESE TWO OBJECTS 24
Groups of entities Thesystemmodel Theuser’s IO devices Theobjectsthatallowcommunicationbetweenthetwoworlds 25
Theuser’s IO devices External interfaces: FMODEx SDL & xffd SDL & OpenGL Files 26
Groups of entities Thesystemmodel Theuser’s IO devices Theobjectsthatallowcommunicationbetweenthetwo “worlds” 27
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 28
There are lots of thingsthatcouldbereusedonotheremulators! 29
Theframework Someabstractions: Devices I/O chips Sound chips Video chips Schedulingprocess 30
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. 31
Theframework Tools: Notmany so far Goal: More interactivedevelopment,doinglessprogramming. 32
Conclusions Smalltalk can do that, too!  The Smalltalk environment is idealfor modeling hardware. Profiling is the key for getting greatperformance without compromisingthe design. 33
Future works Make it cross-platform Make it run in Mac & Linux Keepimprovingtheemulators. Keepevolvingtheframework. Documentation, please! No tests  Make more emulators! 34
Questions? 35
THANK YOU! Gabriel Honoré ghonore@gmail.com http://www.zeek-it.com.ar/retrobjects/ 36

Mais conteúdo relacionado

Semelhante a Retrobjects - Fun with C64 and NES

Assignment instructions
Assignment instructionsAssignment instructions
Assignment instructions
wallinplanet
 
Ch2 pc-components-features-and-system-design
Ch2 pc-components-features-and-system-designCh2 pc-components-features-and-system-design
Ch2 pc-components-features-and-system-design
Boyapati Giri
 
Computer Components
Computer ComponentsComputer Components
Computer Components
Beth Sockman
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
Diksha Bhargava
 
0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab
National Cheng Kung University
 
Y1 gd engine_terminology (1) (4)
Y1 gd engine_terminology (1) (4) Y1 gd engine_terminology (1) (4)
Y1 gd engine_terminology (1) (4)
TomCrook
 
Introduction To Embedded Systems
Introduction To Embedded SystemsIntroduction To Embedded Systems
Introduction To Embedded Systems
anishgoel
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
chon2010
 

Semelhante a Retrobjects - Fun with C64 and NES (20)

PERIPHERAL DEVICES
PERIPHERAL DEVICESPERIPHERAL DEVICES
PERIPHERAL DEVICES
 
Hardware & software in multimedia
Hardware & software in multimediaHardware & software in multimedia
Hardware & software in multimedia
 
ARM Processor Tutorial
ARM Processor Tutorial ARM Processor Tutorial
ARM Processor Tutorial
 
Assignment instructions
Assignment instructionsAssignment instructions
Assignment instructions
 
Readme
ReadmeReadme
Readme
 
Introduction to Game Engine: Concepts & Components
Introduction to Game Engine: Concepts & ComponentsIntroduction to Game Engine: Concepts & Components
Introduction to Game Engine: Concepts & Components
 
Engineterminoligy finished
Engineterminoligy finishedEngineterminoligy finished
Engineterminoligy finished
 
Ch2 pc-components-features-and-system-design
Ch2 pc-components-features-and-system-designCh2 pc-components-features-and-system-design
Ch2 pc-components-features-and-system-design
 
Whyp97
Whyp97Whyp97
Whyp97
 
Mp3 player project presentation
Mp3 player project presentationMp3 player project presentation
Mp3 player project presentation
 
Embest s3 cev40 _neomore
Embest s3 cev40 _neomoreEmbest s3 cev40 _neomore
Embest s3 cev40 _neomore
 
Computer Components
Computer ComponentsComputer Components
Computer Components
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
 
0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab0xdroid -- community-developed Android distribution by 0xlab
0xdroid -- community-developed Android distribution by 0xlab
 
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
 
Y1 gd engine_terminology (1) (4)
Y1 gd engine_terminology (1) (4) Y1 gd engine_terminology (1) (4)
Y1 gd engine_terminology (1) (4)
 
Introduction To Embedded Systems
Introduction To Embedded SystemsIntroduction To Embedded Systems
Introduction To Embedded Systems
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
 
09. User Input
09. User Input09. User Input
09. User Input
 
TS-1679 Excerpt
TS-1679 ExcerptTS-1679 Excerpt
TS-1679 Excerpt
 

Mais de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

Mais de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

Retrobjects - Fun with C64 and NES

  • 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 2
  • 3. What is it? 1º - A Commodore 64emulator 3
  • 4. What is it? 2º - A NintendoEntertainmentSystem (NES) emulator 4
  • 5. Whatisit? 3º - A set of abstractions,components, and toolsthat can behelpfulformakingotheremulators(WIP) FRAMEWORK … … ? 5
  • 7. Motivations I noticed that: People always choose statically-typedlanguages for making them. Proceduraldesigns are preferedwhencomparedtoobject-orienteddesigns. Whyisthat? Performance issues. Isthatreally a problemnowadays? 7
  • 8. Goals Whatdid I wanttoaccomplish? Writeeverything in Smalltalk! . OO design first, then think about performance. Recreatethefeeling of the original machines Highqualityemulation. Createaneasyto useframeworkforwritingcomputer & gameconsoleemulators 8
  • 10. Thesystementities A common C64 system has: 10
  • 12. Groups of entities Objectsfor translation User’s IO devices Thesystementities 12
  • 13. Groups of entities Thesystemmodel Theuser’s IO devices Theobjectsthatallowcommunicationbetweenthetwoworlds 13
  • 14. Thesystemmodel POWER SUPPLY PERIPHERALS MAIN UNIT SOFTWARE MEDIA 14
  • 15. Thesystemmodel Thepowersupply Implementsthe concept of “keepingalive”electricaldevices Works at a specifiedfrequency Manydevices can bepluggedtoit It’simplementedwith aSmalltalkprocess 15
  • 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 17
  • 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 18
  • 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. 19
  • 22. The Video system RETROBJECTS SIDE DEVELOPER ONLYNEEDS TO IMPLEMENT THESE TWO OBJECTS Palette Thesystemmodel Powersource Video chip Frame buffer Color generator External interface TV Converter 22
  • 23. The Audio system RETROBJECTS SIDE Buffer Strategy Thesystemmodel External interface Power source Sound chip Sampler Speaker DEVELOPER ONLYNEEDS TO IMPLEMENT THIS OBJECT 23
  • 24. The Input system OUTSIDE RETROBJECTS RETROBJECTS Thesystemmodel Representation of user’s keyboard User presses The ‘A’ key External interface C64 keyboard Adaptor DEVELOPER ONLYNEEDS TO IMPLEMENT THESE TWO OBJECTS 24
  • 25. Groups of entities Thesystemmodel Theuser’s IO devices Theobjectsthatallowcommunicationbetweenthetwoworlds 25
  • 26. Theuser’s IO devices External interfaces: FMODEx SDL & xffd SDL & OpenGL Files 26
  • 27. Groups of entities Thesystemmodel Theuser’s IO devices Theobjectsthatallowcommunicationbetweenthetwo “worlds” 27
  • 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 28
  • 29. There are lots of thingsthatcouldbereusedonotheremulators! 29
  • 30. Theframework Someabstractions: Devices I/O chips Sound chips Video chips Schedulingprocess 30
  • 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. 31
  • 32. Theframework Tools: Notmany so far Goal: More interactivedevelopment,doinglessprogramming. 32
  • 33. Conclusions Smalltalk can do that, too!  The Smalltalk environment is idealfor modeling hardware. Profiling is the key for getting greatperformance without compromisingthe design. 33
  • 34. Future works Make it cross-platform Make it run in Mac & Linux Keepimprovingtheemulators. Keepevolvingtheframework. Documentation, please! No tests  Make more emulators! 34
  • 36. THANK YOU! Gabriel Honoré ghonore@gmail.com http://www.zeek-it.com.ar/retrobjects/ 36