CPU Emulator Screen GUI Component Not Working!

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CPU Emulator Screen GUI Component Not Working!

akchavarria
Hello all,

I am working on the Fill.asm project for Chapter 4 and am having a problem with the Screen GUI in the CPU Emulator. I first started testing my own script, which instead of using a loop simply stored -1 in the first 24 memory slots mapped to the screen (beginning at 16384), which I confirmed represents 16 1's in binary by switching the "Format" dropdown at the top right of the screen from "Decimal" to "Binary." The only effect this had was to put a black pixel in what I am assuming is the first screen coordinate (1,1). I then decided to search for a full solution which I found at the following location: https://code.google.com/p/nand-to-tetris/source/browse/trunk/project+04+-+Machine+Level+Programming/fill/Fill.asm?r=9. Using this script, I found no difference...still only one black pixel at (1,1). I have attached a screenshot of what the script looks like while running (Animation on) to confirm that it is in fact looping through each screen memory slot and writing a -1 in it. I have also confirmed that no difference is seen in the Screen GUI when turning animation off (No animation).

Any help would be greatly appreciated!

Alejandro

Reply | Threaded
Open this post in threaded view
|

Re: CPU Emulator Screen GUI Component Not Working!

jarrod
I see the exact same issue with my implementation of Fill.asm

I thought I had coded it incorrectly until I tried running it on another machine and it worked perfectly.

On my iMac it display as yours screen shot, when i press a key only one pixel lights up even though all the correct memory locations are set.

On my Macbook Pro with the same code the screen fills and clears correctly.

So far I have checked that they are both running the same version of OSX 10.0.2 and the same version of Java: Java 8 update 45.

If anyone has any suggestions as to what is happening that would be great.
Reply | Threaded
Open this post in threaded view
|

Re: CPU Emulator Screen GUI Component Not Working!

jarrod
Solved this during the current Coursera run of the course in the forums. Reposting my solution here as it solved this for me and others having this issue with the CPU Emulator on OSX.

jarrod wrote
I was having this same 1 pixel issue, and have now fixed it for my iMac.

I thought I had installed the latest Oracle Java as I could see the latest version in the Java Control Panel. It turns out I had only installed the JRE and not the JDK, this had only installed the latest version for use in web browsers and not from the command line.

I checked the version from the command line and saw this:
$ java -version

java version "1.6.0_65"

Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)



I installed the latest JDK and now see this:

$ java -version

java version "1.8.0_45"

Java(TM) SE Runtime Environment (build 1.8.0_45-b14)



My fill code now displays correctly in the CPU Emulator. I guess it is not compatible with the Apple version of Java I had installed.
Reply | Threaded
Open this post in threaded view
|

Re: CPU Emulator Screen GUI Component Not Working!

cadet1620
Administrator
Thank you for this update.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: CPU Emulator Screen GUI Component Not Working!

cadet1620
Administrator
A student sent me this link about installing Java on OS X 10.11 (El Capitan).

How to Install Java in OS X El Capitan

--Mark