Sunday, December 24, 2017
Fiddling with old Time Capsule 1st gen and linux
So I got my hands on an old Apple Time Capsule (1st generation) just to see what it would do.
I wanted to see if it would mount under ubuntu 17.10 with cifs, and the instructions here were pretty useful.
http://blog.martinshouse.com/2014/09/mounting-apple-time-capsule-share-from.html
There was a little snag: It kept giving me Error 112 Host is down.
sudo mount.cifs //1.2.3.4/data -opassword=mypassword,sec=ntlm /mnt/mymountpoint
mount error(112): Host is down
Looking at the dmesg output:
dmesg
[716567.498354] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
[716567.500002] CIFS VFS: SMB response too short (35 bytes)
[716567.500038] CIFS VFS: cifs_mount failed w/return code = -112
I needed to specify the SMB version as 1.0 for mount.cifs or it wouldn't work.
sudo mount.cifs //1.2.3.4/data -opassword=mypassword,sec=ntlm,vers=1.0 /mnt/mymountpoint
=============================================
and interestingly, smbclient won't display the actual share until you tell it not to use ntlmv2.
It will connect but it won't display the Disk.
smbclient -L //1.2.3.4
WARNING: The "syslog" option is deprecated
Server does not support EXTENDED_SECURITY but 'client use spnego = yes' and 'client ntlmv2 auth = yes' is set
Anonymous login successful
Domain=[WORKGROUP] OS=[Apple Base Station] Server=[CIFS 4.32]
Enter WORKGROUP\me's password:
Sharename Type Comment
--------- ---- -------
IPC$ IPC
But if we give it an option of 'client ntlmv2 auth=no', then we can see it.
smbclient -L //1.2.3.4 --option='client ntlmv2 auth=no' -U example
smbclient -L //1.2.3.4 --option='client ntlmv2 auth=no' -U example
WARNING: The "syslog" option is deprecated
Enter WORKGROUP\example's password:
Domain=[WORKGROUP] OS=[Apple Base Station] Server=[CIFS 4.32]
Sharename Type Comment
--------- ---- -------
IPC$ IPC
data Disk
And we can see "data".
Wednesday, December 20, 2017
Huge mouse cursors with Ubuntu 17.10
I couldn't find my mouse cursor easily, so why not make it as big as possible.
First, get the dconf editor and then go to
org / gnome / desktop / interface
and set the cursor-size to 64.
You can set it to larger than 64 but it doesn't get any bigger than 64. I wish I could make it even bigger.
It takes a little getting used to but it's so much easier to see on my 50" tv screen.
You can do it from the command line too:
dconf write /org/gnome/desktop/interface/cursor-size 24
dconf write /org/gnome/desktop/interface/cursor-size 64
https://askubuntu.com/questions/126491/how-do-i-change-the-cursor-and-its-size
First, get the dconf editor and then go to
org / gnome / desktop / interface
and set the cursor-size to 64.
You can set it to larger than 64 but it doesn't get any bigger than 64. I wish I could make it even bigger.
It takes a little getting used to but it's so much easier to see on my 50" tv screen.
You can do it from the command line too:
dconf write /org/gnome/desktop/interface/cursor-size 24
dconf write /org/gnome/desktop/interface/cursor-size 64
https://askubuntu.com/questions/126491/how-do-i-change-the-cursor-and-its-size
Sunday, December 17, 2017
So many tabs and finding the one where you just were
I open a LOT of tabs in firefox. Sometimes it gets confusing to find the tab you were just using. Where is it? Where did it go?
For example, I click on new tab and my new tab opens on the far right of all of my tabs, and the one I was just using scrolls off the visible screen.
It'd be really slick to have a way to find your most recently used tabs, like under the history menu where you've got Recently Closed Tabs menu, just have a Recently Used Tabs menu.
Or a right+click on the List All Tabs button would give you the tabs sorted in order of last use.
Maybe an "about:recent" page.
ALT+TAB will get you to your most recently used window, but CTRL+TAB in firefox goes to the next tab, CTRL+SHIFT+TAB previous tab, not the most recently used tab.
I'm lost in the forest without a trail of breadcrumbs...
===============
A couple of other things that would be useful:
The mini-history in the back button (right click on the back arrow button) only shows you 15 entries, why not give me the option of displaying as many entries as will display on my screen by clicking on a down arrow or something. Scrollable, perhaps.
Also, a quick way to find out which windows are playing videos/sounds would be nice. "About:videos" with maybe an option to stop them all. Or just a menu option "Stop all videos".
================
The latest version of firefox have been auto-repeating my typing when the cpu gets hung up. So I get a lot of exxxxxxxxxxxxxxxtraaaaaaa characters sometimes while typing in the location box.
==================
My latest firefox discovery: The about:about page.
For example, I click on new tab and my new tab opens on the far right of all of my tabs, and the one I was just using scrolls off the visible screen.
It'd be really slick to have a way to find your most recently used tabs, like under the history menu where you've got Recently Closed Tabs menu, just have a Recently Used Tabs menu.
Or a right+click on the List All Tabs button would give you the tabs sorted in order of last use.
Maybe an "about:recent" page.
ALT+TAB will get you to your most recently used window, but CTRL+TAB in firefox goes to the next tab, CTRL+SHIFT+TAB previous tab, not the most recently used tab.
I'm lost in the forest without a trail of breadcrumbs...
===============
A couple of other things that would be useful:
The mini-history in the back button (right click on the back arrow button) only shows you 15 entries, why not give me the option of displaying as many entries as will display on my screen by clicking on a down arrow or something. Scrollable, perhaps.
Also, a quick way to find out which windows are playing videos/sounds would be nice. "About:videos" with maybe an option to stop them all. Or just a menu option "Stop all videos".
================
The latest version of firefox have been auto-repeating my typing when the cpu gets hung up. So I get a lot of exxxxxxxxxxxxxxxtraaaaaaa characters sometimes while typing in the location box.
==================
My latest firefox discovery: The about:about page.
Saturday, December 16, 2017
Ti99 game Rock Runner
I was looking at a page about boulder dash and different variants and wondered if there was a boulder dash clone for the ti99.
I read about this ti99 game rock runner which is a boulder dash clone so I had to give it a go.
There's the author's web page at:
http://www.lafortune.eu/rockrunner/index.html
and I was able to find a disk image on the net.
I've never used a ti99 before so it was difficult to get things set up:
Requirements: Editor/Assembler cartridge, 32K RAM, disk drive, joysticks.
Executable to run: ROCK (E/A Option 5)
./mame64 ti99_4a -cart1 editass -rompath 'mame190roms' -window -screen screen1 -resolution 640x480 -verbose -ioport peb -ioport:peb:slot8 hfdc -ioport:peb:slot2 32kmem -flop1 ../../Rockrun.dsk
I finally realized what E/A option 5 means:
Load the editor/assembler by pressing 2:
Press option 5 to load:
Then type DSK1.ROCK and ENTER (I think it needs to be caps-lock uppercase)
It's pretty challenging to finish the first level in the time limit.
I read about this ti99 game rock runner which is a boulder dash clone so I had to give it a go.
There's the author's web page at:
http://www.lafortune.eu/rockrunner/index.html
Rock Runner Info
8-way scrolling game for the TI-99/4A.
Goal: collecting diamonds in a 2D world.
Simple physics: gravity, lava, bombs, butterflies,...
Written in TMS-9900 assembler.
Development tools: line-by-line assembler, hex editor, Mini Memory module, tape recorder.
Used a novel undocumented half-bitmap graphics mode of the TMS-9918A Video Display Processor.
Program code fitted in 4K of memory.
Distributed by Asgard Software.
and I was able to find a disk image on the net.
I've never used a ti99 before so it was difficult to get things set up:
Requirements: Editor/Assembler cartridge, 32K RAM, disk drive, joysticks.
Executable to run: ROCK (E/A Option 5)
./mame64 ti99_4a -cart1 editass -rompath 'mame190roms' -window -screen screen1 -resolution 640x480 -verbose -ioport peb -ioport:peb:slot8 hfdc -ioport:peb:slot2 32kmem -flop1 ../../Rockrun.dsk
I finally realized what E/A option 5 means:
Load the editor/assembler by pressing 2:
Press option 5 to load:
Then type DSK1.ROCK and ENTER (I think it needs to be caps-lock uppercase)
It's pretty challenging to finish the first level in the time limit.
Friday, December 15, 2017
Why does firefox keep eating my memory on Ubuntu 17.10?
Yes, I've got a lot of tabs open. But after firefox opens it only loads the frontmost tabs in the window.
So why does it keep gobbling memory. I've got 8GB but it slowly keeps allocating memory as I browse until it gets into the swapfile and beyond. And then my system goes unresponsive.
I sure wish I could get firefox to put a cap on how much memory it uses. Or a menu option to flush all of its buffers or something.
I just have to watch it closely with system-monitor and when it gets too big just close it and reopen it. Often when it makes a huge swapfile, when you close firefox it tells you that it crashed, probably because it took too long to shut itself down.
As much time as I've wasted I think I'll be boosting up my memory.
So why does it keep gobbling memory. I've got 8GB but it slowly keeps allocating memory as I browse until it gets into the swapfile and beyond. And then my system goes unresponsive.
I sure wish I could get firefox to put a cap on how much memory it uses. Or a menu option to flush all of its buffers or something.
I just have to watch it closely with system-monitor and when it gets too big just close it and reopen it. Often when it makes a huge swapfile, when you close firefox it tells you that it crashed, probably because it took too long to shut itself down.
As much time as I've wasted I think I'll be boosting up my memory.
Ubuntu 17.10 and losing my EDID on a vga splitter
So I got a new 50 inch tv and I thought it'd be great to use it as a monitor. Getting a VGA splitter device allows me to hook up my 24 inch monitor and pipe the output into the TV's VGA input.
It looks great, but after rebooting, I discovered that I had lost the ability to read the monitor's EDID info so ubuntu gives me a 1024x768 display instead of the 1920x1080 display.
After reading a whole bunch of pages with suggestions and tips, here's what worked for me:
First get the read-edid with "sudo apt-get install read-edid"
I read the EDID info with just my original hannsg 24 connected and wrote that to a file.
sudo get-edid -b 1 > hannsg.bin
The -b is the bus number. As I have dual monitors, I had to figure out which bus it was on. One of my missteps was getting the edid for my other monitor (which tops out at 1280x1024) accidentally, hence manually specifying the bus number.
To make sure you've got the right monitor, pipe it to parse-edid:
cat hannsg.bin | parse-edid
and that should tell you that you've got the right monitor.
now you want to copy that file into /lib/firmware/edid
sudo mkdir /lib/firmware/edid
sudo cp hannsg.bin /lib/firwmare/edid/hannsg.bin
now I edit my ubuntu grub booting configuration:
sudo nano /etc/default/grub
There are built-in edid for common resolutions but this will only get you that one specific resolution:
You can try specifying a specific resolution like so:
GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin"
GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin"
I have changed the HIDDEN_TIMEOUT to 5 seconds so I have time to hit esc to get the GRUB menu after a reboot and also so you can edit the command line in grub with "e" (and CTRL+X to edit the grub boot editor). It's pretty useful to have the grub boot editor if you just want to test a specific command line settings without making permanent changes).
===============================
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=5
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"
GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"
========================================
the important lines here are the ones with the drm_kms_helper
GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"
GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"
This is what the original section of /etc/default/grub looked like:
==================================================
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
=======================================================
Once you make your edits and save, then
sudo update-grub
So now after boot I get this when I check my dmesg:
dmesg | grep edid
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin
[ 2.521260] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "VGA-1"
[ 34.742536] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "VGA-1"
[ 57.856240] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "VGA-1"
dmesg | grep edid
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin
[ 2.445432] platform VGA-1: Direct firmware load for edid/hannsg.bin failed with error -2
[ 2.445470] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Requesting EDID firmware "edid/hannsg.bin" failed (err=-2)
[ 33.654278] [drm] Got external EDID base block and 0 extensions from "edid/hannsg.bin" for connector "VGA-1"
[ 63.689153] [drm] Got external EDID base block and 0 extensions from "edid/hannsg.bin" for connector "VGA-1"
And a couple of notes:
I have specified a connector name with "VGA-1:" so it gets that edid for that particular connector.
You can get the connector names by looking at /sys/class/drm
ls /sys/class/drm/
card0 card0-DP-1 card0-HDMI-A-1 card0-VGA-1 renderD128 version
Also I had problems because I didn't put the edid in the correct directory. One webpage I looked at said /usr/lib/firmware/edid which didn't work for me: I had to put it in /lib/firmware/edid. After I did that I was golden.
Before that I was getting these strange error -2 couldn't load the edid/hannsg.bin messages in my dmesg log. I do get an error -2 but it keeps retrying and finds it once it mounts the filesystem I think.
Doing a "dmesg | grep mount" tells me that my file system isn't mounted until 3.1 seconds mark so that's probably what's happening.
[ 3.137360] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 9.739364] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
Now I can hook up my vga splitter box and it happily loads the proper edid and everything is right with the world.
I must've rebooted about 20-30 times to get this working. I found this process most difficult so I hope this helps you avoid the same frustration!
It'd be really cool to just have a "choose custom resolution" button in the display settings where you could enter "1920x1080x60" for example when it can't get a proper edid. That would be too easy, I guess 8-)
Another thing you can try is this from a terminal:
echo "VGA-1:edid/hannsg.bin" | sudo tee /sys/module/drm_kms_helper/parameters/edid_firmware
(you need the tee even when you've done the sudo because it's the shell that does the redirection)
echo "VGA-1:edid/hannsg.bin" > /sys/module/drm_kms_helper/parameters/edid_firmware
bash: /sys/module/drm_kms_helper/parameters/edid_firmware: Permission denied
If you have specified a value for this, then you see the value that you've set:
cat /sys/module/drm_kms_helper/parameters/edid_firmware
VGA-1:edid/hannsg.bin
Thursday, November 2, 2017
My Weatherdirect boxes don't work anymore
*sniff* Weatherdirect has shut down its forecast service for their wireless forecasters that connected to the internet.
My unit(s) stopped working a couple of weeks ago and I read this on weatherdirect.com:
August 9th, 2017
IMPORTANT ANNOUNCEMENT REGARDING WEATHER DIRECT FORECASTING SERVICE
If you are currently utilizing a WD- or WA- Series (Model # begins with WD- or WA-) weather station to receive forecasts, please read on for important information about your station.
Due to changing technology, reduced demand and a changing market-place that is driven by connected devices and phones, we will be discontinuing our Weather Direct Forecasting Service to all WA- and WD- Devices effective August 31st, 2017.
device We apologize for any inconvenience that discontinuing service on your Weather Direct station will or may cause. Current Weather Direct users should have received an email notification of this as well, and a second email will be sent with more information on possible replacement items for your unit.
It is our goal to exceed your expectations in our products and in our customer service, and we are committed to making the transition from old to new as easy as possible for our customers.
Please feel free to contact us with any questions at http://www.lacrossetechnology.com/support/index/form/
Sincerely,
La Crosse Technology
*sigh* I really liked these units as you could connect multiple receivers to one internet-connected transmitter. My favorite was the WA-1440U 4-Day Talking Internet-Powered Wireless Forecaster where you could send it speech and it could read the news for example. You could even customize it with your name for example and the speech was extremely smooth and fluid.
I had 3 units around the house and it was nice to glance at them to see what the weather would be. They will be missed.
It would be so awesome if someone could reverse engineer the wireless protocol but that'd be pretty difficult now that its all shut down.
My unit(s) stopped working a couple of weeks ago and I read this on weatherdirect.com:
August 9th, 2017
IMPORTANT ANNOUNCEMENT REGARDING WEATHER DIRECT FORECASTING SERVICE
If you are currently utilizing a WD- or WA- Series (Model # begins with WD- or WA-) weather station to receive forecasts, please read on for important information about your station.
Due to changing technology, reduced demand and a changing market-place that is driven by connected devices and phones, we will be discontinuing our Weather Direct Forecasting Service to all WA- and WD- Devices effective August 31st, 2017.
device We apologize for any inconvenience that discontinuing service on your Weather Direct station will or may cause. Current Weather Direct users should have received an email notification of this as well, and a second email will be sent with more information on possible replacement items for your unit.
It is our goal to exceed your expectations in our products and in our customer service, and we are committed to making the transition from old to new as easy as possible for our customers.
Please feel free to contact us with any questions at http://www.lacrossetechnology.com/support/index/form/
Sincerely,
La Crosse Technology
*sigh* I really liked these units as you could connect multiple receivers to one internet-connected transmitter. My favorite was the WA-1440U 4-Day Talking Internet-Powered Wireless Forecaster where you could send it speech and it could read the news for example. You could even customize it with your name for example and the speech was extremely smooth and fluid.
I had 3 units around the house and it was nice to glance at them to see what the weather would be. They will be missed.
It would be so awesome if someone could reverse engineer the wireless protocol but that'd be pretty difficult now that its all shut down.
Friday, October 6, 2017
Ubuntu 17.04 screen redraw after coming out of standby
One of the things that is really annoying me is that the Ubuntu screen doesn't redraw itself properly when coming out of screen saver or when coming out of standby.
The screen is double buffered and one of the buffers doesn't get fully updated, so you get this horrible flashing/flicker effect.
So I have to take one of the windows and pull it up to the top of the screen to force a full screen refresh since it does that "zoom animation thing".
I wonder if it's worse because I run a dual monitor setup.
It's just kind of annoying as I hate anything that flickers. Just redraw that screen, baby!
I'm just running integrated intel graphics.
lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
lspci -v -n
00:02.0 0300: 8086:0152 (rev 09) (prog-if 00 [VGA controller])
Subsystem: 17aa:308c
Flags: bus master, fast devsel, latency 0, IRQ 26
Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000 [size=64]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities:
Kernel driver in use: i915
Kernel modules: i915
The screen is double buffered and one of the buffers doesn't get fully updated, so you get this horrible flashing/flicker effect.
So I have to take one of the windows and pull it up to the top of the screen to force a full screen refresh since it does that "zoom animation thing".
I wonder if it's worse because I run a dual monitor setup.
It's just kind of annoying as I hate anything that flickers. Just redraw that screen, baby!
I'm just running integrated intel graphics.
lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)
lspci -v -n
00:02.0 0300: 8086:0152 (rev 09) (prog-if 00 [VGA controller])
Subsystem: 17aa:308c
Flags: bus master, fast devsel, latency 0, IRQ 26
Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000 [size=64]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities:
Kernel driver in use: i915
Kernel modules: i915
Saturday, September 30, 2017
TMS9918A added graphics mode 2 with 50 transistors
It's interesting to read up on the history of the TMS9918 and how they added the "super pattern graphics mode" aka Graphics Mode II with only 50 transistors. That allowed a full bitmap display to be generated with each color table byte setting a group of 8 pixels to have 2 colors out of 16.
Fascinating.
http://msx.hansotten.com/technical-info/tms9918/
The specific document being:
http://msx.hansotten.com/uploads/files/198x%20Super%20Pattern%20Graphics%20Mode%20(Mode%202).pdf
Fascinating.
http://msx.hansotten.com/technical-info/tms9918/
The specific document being:
http://msx.hansotten.com/uploads/files/198x%20Super%20Pattern%20Graphics%20Mode%20(Mode%202).pdf
Sunday, September 24, 2017
Writing to both the Third Millenium Arcade Board and the Super Sprite.
I wanted to write to the Third Millenium Arcade Board and the Super Sprite, but there's just one problem: The Super Sprite has its addresses at $C0F0 and $C0F1.
You can write to those addresses just fine in machine language with STA $C0F1 but an AppleSoft POKE doesn't work the same.
Applesoft POKE actually executes a STA ($50),Y to address $C0F1, but that actually reads $C0F1 before it writes $C0F1. It's kind of counter intuitive that you would have a read when you're trying to write something, but that's the wacky design of the 6502.
That read has the side effect of resetting the TMS9918A address pointer so when it writes, the TMS9918 thinks you want to specify the low byte of the address pointer. Each time you write $C0F1 it resets that pointer so you never actually finish setting the high byte of address pointer.
So you have to resort to assembly language, and I poke a little routine into memory and then call it. STA absolute doesn't have the same problem as the STA ($50),Y register indirect mode and it will write to $C0F1 properly without reading it first.
This applesoft program is horribly unoptimized, I just wanted something that would work.
It you let it run for a few minutes it will display the following:
(hint: display the frameskip with F11, set the frameskip to 6 with F8/F9 and unthrottle with F10 to speed things up)
./mame64 apple2e -sl4 arcbd -sl7 ssprite
The simple routines I poke into memory and call: 4000: 2 writes to C0F1 to set an address, reading C0F1 first to make sure we reset the address register It's a register write if the second byte has the hi byte set. 4014: same routine as 4000 It's an address write if the second byte has bit 6 set, bit 6 clear if just to read. 4028: write to C0F0, write DATA register 403C: read from C0F0, read DATA register ]CALL -151 *4000L 4000- AD F1 C0 LDA $C0F1 4003- A9 0F LDA #$0F 4005- 8D F1 C0 STA $C0F1 4008- A9 87 LDA #$87 400A- 8D F1 C0 STA $C0F1 400D- 60 RTS 400E- 00 BRK 400F- 00 BRK 4010- 00 BRK 4011- 00 BRK 4012- 00 BRK 4013- 00 BRK 4014- AD F1 C0 LDA $C0F1 4017- A9 00 LDA #$00 4019- 8D F1 C0 STA $C0F1 401C- A9 78 LDA #$78 401E- 8D F1 C0 STA $C0F1 4021- 60 RTS 4022- 00 BRK 4023- 00 BRK *L 4024- 00 BRK 4025- 00 BRK 4026- 00 BRK 4027- 00 BRK 4028- A9 78 LDA #$78 402A- 8D F0 C0 STA $C0F0 402D- 60 RTS 402E- 00 BRK 402F- 00 BRK 4030- 00 BRK 4031- 00 BRK 4032- 00 BRK 4033- 00 BRK 4034- 00 BRK 4035- 00 BRK 4036- 00 BRK 4037- 00 BRK 4038- 00 BRK 4039- 00 BRK 403A- 00 BRK *L 403B- 00 BRK 403C- AD C0 C0 LDA $C0C0 403F- 8D 4E 40 STA $404E 4042- 60 RTS 4043- 00 BRK 4044- 00 BRK 4045- 00 BRK 4046- 00 BRK 4047- 00 BRK 4048- 00 BRK 4049- 00 BRK 404A- 00 BRK 404B- 00 BRK 404C- 00 BRK 404D- 00 BRK 404E- 00 BRK 404F- 00 BRK 4050- 00 BRK 4051- 00 BRK 4052- 00 BRK
Monday, September 18, 2017
Copy the Apple ii text screen to the Third Millenium Arcade Board
So I thought I'd see if I could copy the apple ii's text screen to the tms9918.
Once I've loaded the font into the tms9918 memory, I can just copy bytes from the apple ii's text screen to the tms9918's memory.
Yes, it's not optimized, because I was assembling it by hand with the CALL -151 monitor.
So to write bytes to the TMS9918, you write the low byte of the address to $C0C3, then the high byte with bit 6 set (so we add 64 or $40). We want to write to location zero, so that means writing a $00, then a $40 to $C0C3.
Now any bytes written to $C0C2 will go to that address and then auto-increment the destination address.
We use the routine at $FBC1 to calculate the address of the text line given in A. That clobbers A so we have to restore it. It stores the address in $28 and $29. We use LDA ($28),Y to access the text memory, then STA it to $C0C2. Keep going until we get 32 chars in the line CPY #$20, and then keep going until we've done 24 lines CPX #$18.
If you're wondering why it's multicolored, I was experimenting with the TMS9918 color table.
My uploaded font, with the characters from 0-127 copied to 128-255 and colored with the color table. The color table for the 32x24 mode 0 has 32 bytes total: a single color for 8 character patterns.
I think the crazy colors look cool. Distracting but kind of cool.
Once I've loaded the font into the tms9918 memory, I can just copy bytes from the apple ii's text screen to the tms9918's memory.
Yes, it's not optimized, because I was assembling it by hand with the CALL -151 monitor.
So to write bytes to the TMS9918, you write the low byte of the address to $C0C3, then the high byte with bit 6 set (so we add 64 or $40). We want to write to location zero, so that means writing a $00, then a $40 to $C0C3.
Now any bytes written to $C0C2 will go to that address and then auto-increment the destination address.
We use the routine at $FBC1 to calculate the address of the text line given in A. That clobbers A so we have to restore it. It stores the address in $28 and $29. We use LDA ($28),Y to access the text memory, then STA it to $C0C2. Keep going until we get 32 chars in the line CPY #$20, and then keep going until we've done 24 lines CPX #$18.
4030- A9 00 LDA #$00 4032- 8D C3 C0 STA $C0C3 4035- A9 40 LDA #$40 4037- 8D C3 C0 STA $C0C3 403A- A9 00 LDA #$00 403C- AA TAX 403D- 8A TXA 403E- 20 C1 FB JSR $FBC1 4041- A0 00 LDY #$00 4043- 48 PHA 4044- B1 28 LDA ($28),Y 4046- 8D C2 C0 STA $C0C2 4049- 68 PLA 404A- C8 INY 404B- C0 20 CPY #$20 404D- 30 F4 BMI $4043 404F- E8 INX 4050- E0 18 CPX #$18 4052- 30 E9 BMI $403D 4054- 60 RTS
If you're wondering why it's multicolored, I was experimenting with the TMS9918 color table.
My uploaded font, with the characters from 0-127 copied to 128-255 and colored with the color table. The color table for the 32x24 mode 0 has 32 bytes total: a single color for 8 character patterns.
I think the crazy colors look cool. Distracting but kind of cool.
Sunday, September 17, 2017
Fun with TMS9918 fonts on the Third Millenium Arcade Board
So you have to upload fonts to the TMS9918 to get it to display anything textwise.
I came across this great thread about ti fonts by sometimes99er where he has put together a bunch of great fonts in gif format:
http://atariage.com/forums/topic/165697-fonts/
There was one font in particular that is near and dear to me: The classic Amiga font.
Let's see if we can get the Apple II Third Millenium Arcade Board's TMS9918 to display it.
First, I thought I'd use HTML5 and firefox to generate the DATA statements for Applesoft:
So we create a canvas, draw the 0236.chr.gif into the canvas, and use getImageData() to get access to the data and generate a bunch of DATA statements.
This HTML5 generates the following DATA statements.
and we paste this into mame's apple2 driver with SHIFT+Scroll Lock to enter it into our basic program:
and I choose background B = 4 and foreground F = 15 for white text on blue for that classic look.
Friday, September 15, 2017
Disassembling the VDPTEST program for the Third Millenium Enginnering Arcade Board
So I thought I'd have a look at what the VDPTEST program actually does.
Doing a PR#1 and LOAD VDPTEST and LIST gets me:
What you see the basic program do is to BLOAD VDPTST which goes to address $1000 (4096) and it will patch it with the proper io addresses for the slot number. So every occurrence of C0C0 and C0C1 will get patched.
It will CALL 4096 after the patching and it writes the entire 16K ($4000) of the TMS9918 with the value held in memory location $104C and then reads it back, comparing it to what's in $104C.
If it gets an error, it writes $00 to address $2000 (8192), but if everything is cool it writes $CC to address $2000 (8192).
What is complete BS is the error reporting in the basic program. It looks for error information at 8193, 8194, 8195 and 8196, but quite frankly I don't see where it's getting this information, because the assembly program just doesn't write those locations. There should be an STX $2003, an STY $2004 or something.
It'll tell you there's an error, but the information reported is bogus.
I kept trying to figure out what the CALL 768 does. The CALL 768 in the program is setup in the HELLO program on the disk. It just resets the apple video output on reset according to the REM remarks.
So for fun, I thought I'd patch it by hand with the monitor so it would send the proper values to the basic program if there were an error. There's nothing like changing those values by hand.
I tested it using the mame debugger and changing the values in the TMS9918 vram by hand to simulate a memory error.
What was really driving me crazy is that the basic VDPTEST program kept patching the addresses after I'd changed them. A little "175 GOTO 210" fixed that. I changed the instances of $C0C1 to $C0C3 and $C0C0 to $C0C2 to get it to run under mame 189.
Doing a PR#1 and LOAD VDPTEST and LIST gets me:
What you see the basic program do is to BLOAD VDPTST which goes to address $1000 (4096) and it will patch it with the proper io addresses for the slot number. So every occurrence of C0C0 and C0C1 will get patched.
It will CALL 4096 after the patching and it writes the entire 16K ($4000) of the TMS9918 with the value held in memory location $104C and then reads it back, comparing it to what's in $104C.
If it gets an error, it writes $00 to address $2000 (8192), but if everything is cool it writes $CC to address $2000 (8192).
What is complete BS is the error reporting in the basic program. It looks for error information at 8193, 8194, 8195 and 8196, but quite frankly I don't see where it's getting this information, because the assembly program just doesn't write those locations. There should be an STX $2003, an STY $2004 or something.
It'll tell you there's an error, but the information reported is bogus.
I kept trying to figure out what the CALL 768 does. The CALL 768 in the program is setup in the HELLO program on the disk. It just resets the apple video output on reset according to the REM remarks.
So for fun, I thought I'd patch it by hand with the monitor so it would send the proper values to the basic program if there were an error. There's nothing like changing those values by hand.
I tested it using the mame debugger and changing the values in the TMS9918 vram by hand to simulate a memory error.
What was really driving me crazy is that the basic VDPTEST program kept patching the addresses after I'd changed them. A little "175 GOTO 210" fixed that. I changed the instances of $C0C1 to $C0C3 and $C0C0 to $C0C2 to get it to run under mame 189.
Monday, September 11, 2017
Samsung 171v and gddccontrol
There's no monitor file for the Samsung 171v (SAM0063.xml)l in ddccontrol-db, but there is a listing for the Samsung 173s in the (SAM00A3.xml) file which is extremely similar.
So we'll copy that and put it into /usr/share/ddccontrol-db/monitor/SAM0063.xml.
There's no speakers so we'll take the 62 entry out of the caps add line.
So if you're curious, here's the full ddccontrol -c -p -d output:
So we'll copy that and put it into /usr/share/ddccontrol-db/monitor/SAM0063.xml.
There's no speakers so we'll take the 62 entry out of the caps add line.
So if you're curious, here's the full ddccontrol -c -p -d output:
Tuesday, September 5, 2017
Fun with the Synetix SuperSprite board
I was looking at the old Creative Computing article again about the Third Millenium Arcade Board and the Synetix Supersprite board and I thought, why not see if I could make a copy of the a2arcadebd.cpp and see if the SuperSprite would work?
So let's take a2arcadebd.h and a2arcadebd.cpp and search and replace arcadebd with ssprite, and change a few of the strings, and save it as a2ssprite.h and a2ssprite.cpp. The Synetix Supersprite demos hang when it tries to do speech, so we hook up a tms5220, copying lines from a2echoii.cpp.
src/devices/bus/a2bus/a2ssprite.h
src/devices/bus/a2bus/a2ssprite.cpp
and we need to hook it up in the apple2e driver with an #include and a SLOT_INTERFACE and put a couple of lines in bus.lua for a2ssprite.h and a2ssprite.cpp:
After you do this and compile with make you can launch mame with the -sl7 ssprite parameter and run the supersprite demo programs.
./mame64 apple2e -sl7 ssprite -flop1 "StarSprite Demonstration.DSK"
from "Third Millenium Arcade Board - Article Creative Computing 1984.pdf"
So let's take a2arcadebd.h and a2arcadebd.cpp and search and replace arcadebd with ssprite, and change a few of the strings, and save it as a2ssprite.h and a2ssprite.cpp. The Synetix Supersprite demos hang when it tries to do speech, so we hook up a tms5220, copying lines from a2echoii.cpp.
src/devices/bus/a2bus/a2ssprite.h
src/devices/bus/a2bus/a2ssprite.cpp
and we need to hook it up in the apple2e driver with an #include and a SLOT_INTERFACE and put a couple of lines in bus.lua for a2ssprite.h and a2ssprite.cpp:
After you do this and compile with make you can launch mame with the -sl7 ssprite parameter and run the supersprite demo programs.
./mame64 apple2e -sl7 ssprite -flop1 "StarSprite Demonstration.DSK"
from "Third Millenium Arcade Board - Article Creative Computing 1984.pdf"
Saturday, August 26, 2017
Getting the Third Millenium Arcade Board MLDEMOS to run
I loaded up the MLDEMOS on the Third Millenium arcade board and took a look at where it was hanging up.
./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do -debug
It was spinning in a loop around 088e and proceeding no further.
I set a break point at 088e with "bpset 088e" and after it hit the breakpoint, did a "history".
It was obviously writing data to $c0c1 and $c0c0.
I also did a disassembly from 800 to 1800 with "dasm mldemo.asm,800,1000" to take a look at.
less mldemo.asm | grep '$c0c1'
08E4: AD C1 C0 lda $c0c1
0990: 8D C1 C0 sta $c0c1
0993: 8E C1 C0 stx $c0c1
0A80: 8D C1 C0 sta $c0c1
0A83: 8C C1 C0 sty $c0c1
less mldemo.asm | grep '$c0c0'
0859: 8D C0 C0 sta $c0c0
09B3: 8D C0 C0 sta $c0c0
09DE: 8D C0 C0 sta $c0c0
0A09: 8D C0 C0 sta $c0c0
0A3B: 8D C0 C0 sta $c0c0
0A68: 8D C0 C0 sta $c0c0
The arcade board is supposed to be in slot#4 which maps to the $c0cx memory space, and the code in a2arcade.cpp looks like this:
======================================================
So if it's writing c0c0 and c0c1, nothing is happening since we've got no cases for that.
So let's add case 0 and case 1: (assuming they're just like case 2 and 3)
=================================
And things start working!
Happy guy from the MLDEMO hotel scene:
./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do -debug
It was spinning in a loop around 088e and proceeding no further.
I set a break point at 088e with "bpset 088e" and after it hit the breakpoint, did a "history".
It was obviously writing data to $c0c1 and $c0c0.
I also did a disassembly from 800 to 1800 with "dasm mldemo.asm,800,1000" to take a look at.
less mldemo.asm | grep '$c0c1'
08E4: AD C1 C0 lda $c0c1
0990: 8D C1 C0 sta $c0c1
0993: 8E C1 C0 stx $c0c1
0A80: 8D C1 C0 sta $c0c1
0A83: 8C C1 C0 sty $c0c1
less mldemo.asm | grep '$c0c0'
0859: 8D C0 C0 sta $c0c0
09B3: 8D C0 C0 sta $c0c0
09DE: 8D C0 C0 sta $c0c0
0A09: 8D C0 C0 sta $c0c0
0A3B: 8D C0 C0 sta $c0c0
0A68: 8D C0 C0 sta $c0c0
The arcade board is supposed to be in slot#4 which maps to the $c0cx memory space, and the code in a2arcade.cpp looks like this:
======================================================
/*
C0nx map:
0 - TMS read vram
1 - TMS read status
2 - TMS write vram
3 - TMS write register
5 - AY register select
6 - AY data
*/
void a2bus_arcboard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data)
{
switch (offset)
{
case 2:
m_tms->vram_write(space, 0, data);
break;
case 3:
m_tms->register_write(space, 0, data);
break;
case 5:
m_ay->address_w(space, 0, data);
break;
case 6:
m_ay->data_w(space, 0, data);
break;
}
}
So if it's writing c0c0 and c0c1, nothing is happening since we've got no cases for that.
So let's add case 0 and case 1: (assuming they're just like case 2 and 3)
=================================
void a2bus_arcboard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data)
{
switch (offset)
{
case 0:
m_tms->vram_write(space, 0, data);
break;
case 1:
m_tms->register_write(space, 0, data);
break;
case 2:
m_tms->vram_write(space, 0, data);
break;
case 3:
m_tms->register_write(space, 0, data);
break;
case 5:
m_ay->address_w(space, 0, data);
break;
case 6:
m_ay->data_w(space, 0, data);
break;
}
}
And things start working!
Happy guy from the MLDEMO hotel scene:
Friday, August 25, 2017
Playing with the Arcade Board on Apple2e
I thought I'd see what the Arcade Board would do on the apple2e driver. If you didn't know what it is, it's a card that has a tms9918 graphics chip and a sound chip.
So the arcade board prefers to be in slot 4.
./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do
and once it boots, you can run the basic demos.
But just for fun, let's see what modifying the TMS9918 memory will do, so we launch mame with the debug.
./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do -debug
If you CTRL+C the basic demo, the animation stops.
So let's open a memory window and choose the TMS9918 vram space:
and I've written bytes 68 6A to memory positions 00 and 01
and 69 6B to memory positions 20 and 21, which has the effect of changing the tiles to the letter M.
and you can see the M in the upper left:
So the arcade board prefers to be in slot 4.
./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do
and once it boots, you can run the basic demos.
But just for fun, let's see what modifying the TMS9918 memory will do, so we launch mame with the debug.
./mame64 apple2e -sl4 arcbd -flop1 Amparcade_1983_Third_Millenium_Engineering_Corporation.do -debug
If you CTRL+C the basic demo, the animation stops.
So let's open a memory window and choose the TMS9918 vram space:
and I've written bytes 68 6A to memory positions 00 and 01
and 69 6B to memory positions 20 and 21, which has the effect of changing the tiles to the letter M.
and you can see the M in the upper left:
Thursday, August 24, 2017
Getting 80 column BASIC listing on apple2e
So I was disappointed that I could only get a 40 column wide printout from my basic listing, so I tried PR#3 to activate the 80 column card but once you activate the printer with PR#1, that brings it back to 40 columns.
Thinking about it, I remembered that Beagle's Double-take would let me do listings in any column width.
Launching mame with the double take floppy:
./mame64 apple2e -sl1 ssc -sl1:ssc:ssc_rs232 printer -printout myprintfile8.bin -flop1 Double\ Take.zip
Booting double-take and then
CTRL+F shift+1 /80 will get you 80 columns
CTRL+F shift+1 /255 will get you 255 columns
Interestingly, mame's -printout function won't wipe out your previous printout file if it has the same name, it just overwrites the data in the existing file.
Thinking about it, I remembered that Beagle's Double-take would let me do listings in any column width.
Launching mame with the double take floppy:
./mame64 apple2e -sl1 ssc -sl1:ssc:ssc_rs232 printer -printout myprintfile8.bin -flop1 Double\ Take.zip
Booting double-take and then
CTRL+F shift+1 /80 will get you 80 columns
CTRL+F shift+1 /255 will get you 255 columns
Interestingly, mame's -printout function won't wipe out your previous printout file if it has the same name, it just overwrites the data in the existing file.
Wednesday, August 23, 2017
Getting a BASIC listing from mame's apple2e driver
So after much much fiddling, I've figured out how to get my basic listing out of the apple2e driver in mame 0.188.
I launch mame with the following command line:
./mame64 apple2e -sl1 ssc -sl1:ssc:ssc_rs232 printer -printout myprintfile.bin
and then I ctrl+reset (ctrl+f12) to get to a command prompt, type
PR#1
PRINT "HELLO THERE"
PR#0
and then drop out of mame with ESC.
But I look at the output file and it's not right.
tr '\200-\377' '\000-\177' translates characters 128-255 to 0-127.
I suppose that I could just set the SSC card to 7 bits.
I launch mame with the following command line:
./mame64 apple2e -sl1 ssc -sl1:ssc:ssc_rs232 printer -printout myprintfile.bin
and then I ctrl+reset (ctrl+f12) to get to a command prompt, type
PR#1
PRINT "HELLO THERE"
PR#0
and then drop out of mame with ESC.
But I look at the output file and it's not right.
hexdump -C myprintfile.bin 00000000 8d 8a dd d0 d2 c9 ce d4 a0 a2 c8 c5 cc cc cf a0 |................| 00000010 d4 c8 c5 d2 c5 a2 8d 8a c8 c5 cc cc cf a0 d4 c8 |................| 00000020 c5 d2 c5 8d 8a 8d 8a dd d0 d2 a3 b0 8d 8a |..............| 0000002eSo I use unix tr to get rid of the high bit, and the text is there.
tr '\200-\377' '\000-\177' translates characters 128-255 to 0-127.
cat myprintfile.bin | tr '\200-\377' '\000-\177' | hexdump -C 00000000 0d 0a 5d 50 52 49 4e 54 20 22 48 45 4c 4c 4f 20 |..]PRINT "HELLO | 00000010 54 48 45 52 45 22 0d 0a 48 45 4c 4c 4f 20 54 48 |THERE"..HELLO TH| 00000020 45 52 45 0d 0a 0d 0a 5d 50 52 23 30 0d 0a |ERE....]PR#0..| 0000002eSo now I can get my listing, hooray!
I suppose that I could just set the SSC card to 7 bits.
Saturday, August 19, 2017
Checker King for apple 2
I've been playing a bunch of apple 2 games lately, and rather enjoying the "classics".
I fired up this game disk called "The Black Sage" and interestingly, after running a catalog, finding a Checkers game called Checker King.
You type N to put numbers on the squares (so you know what square is what)
P to pass (though I thought you weren't allowed to pass)
R to reset everything
C to clear everything
M to change the pieces
IQ8 to set the computer's intelligence to level 8, can set from level 1 to 8
and a typical move will be something like:
22-18
and if you can do multiple jumps just put dashes between each step
25-18-9
I fired up this game disk called "The Black Sage" and interestingly, after running a catalog, finding a Checkers game called Checker King.
You type N to put numbers on the squares (so you know what square is what)
P to pass (though I thought you weren't allowed to pass)
R to reset everything
C to clear everything
M to change the pieces
IQ8 to set the computer's intelligence to level 8, can set from level 1 to 8
and a typical move will be something like:
22-18
and if you can do multiple jumps just put dashes between each step
25-18-9
Subscribe to:
Posts (Atom)