#hotkeyemu — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #hotkeyemu, aggregated by home.social.
-
The definition of insanity is starting working on a IIgs emulator while your Apple II emulator is barely working.
-
My Apple II emulator is near perfection :meow_googlytrash:
-
So the BASIC actually basics now, which I hear is a good thing as far as basicing is concerned.
-
The good news is that chasing this bug only took me *mumble* hours!
Thanks to the MC-10 BASIC instruction parsing code for using the stack pointer in a... creative... manner (to be fair what they are doing is 100% legal)
Basically (get it?) they are using the stack pointer as an index for the line being parsed because the index register is already busy going through the token table. That's pretty neat.
-
Pour les amis Francais, c'est le Matra Alice (même mécanique avec un joli boitier rouge et un clavier AZERTY)
-
🎵 It's beginning to look a lot like... a TRS-80 MC-10 🎵 (wat? why?)
I think this was Tandy's answer to the cheap ZX81/VIC-20. Very limited, not much ram (4K, 20K max). Not really compatible with the other colour computers. You can guess it was not a big hit.
Still, I had a 6800 CPU emulation laying around (this one uses a 6803, which is a 6800 + 128bytes ram + io ports integrated), and I wanted to start working on the MC6847 video chip (used in CoCos and such) so why not.
-
✅ Set standard memory map (no support for bank switching yet except laying the foundations)
✅ Mock VIC2 chip io registersHouston, we have a C64 boot screen in VRAM! (you have to squint a bit) :meow_bongo_keyboard:
-
Nobody:
Me: Ok, ok, you win − I'll try to make a barebones C64 emulator.
I need to get back in the game. And also, it *was* my first computer.
No way I do a complete SID or VIC emulation though, just the basics.
-
The TMS1000 is a family of 4-bit microcontrollers from the 70s ( https://en.wikipedia.org/wiki/Texas_Instruments_TMS1000 )
They were used in a number of portable video games and calculators of the 70s and 80s: Simon, Speak n Spell, various "repeat the sound/colors" games, sports games, space invaders...
And, most importantly, the Merlin electronic wizard game by Parker Brothers ( https://en.wikipedia.org/wiki/Merlin_(console) ).
Why it is so important? Because I had one as a kid of course!
1/6
-
I made that thing a few years ago.
If anyone's curious I'll do a small show and tell tomorrowBonus points if you recognize what it is.
-
I don't have enough dangling/abandoned branches for my emulator, I should start a few more.
-
Thinking about getting back to my SMS (Sega Master System) emulator but then I remember in what hair-pulling state I left it in (stuck on the video chip) and I'm not sure anymore lol
(The SEGA letters are supposed to be partially covered)
-
My Mac isn't done but I think I need a change of scenery, maybe go back to 8 bit computers.
Don't really have a "new" CPU to implement though (I've done most of the "big" 8 bit ones). So... erm... MSX? Tandy CoCo? Something weird and/or obscure?
I dunno... I'm open to suggestions.
What I have done, at various levels of "done":
8088: XT, Tandy 1000, PCjr
80286: PC/AT
6502: PET, VIC-20
Z80: Sinclair Spectrum, ColecoVision, Amstrad CPC
6809: Thomson MO5/TO7
68000: Macintosh 128k -
If anyone is wondering why: The Mac 128k needs raw quadrature encoder data from the mouse (half on the SCC serial controller and half on the VIA which sucks because I had to partially implement the SCC just for that).
Raw quadrature data gives you a "one step up/down/left/right" signal.
But the mouse deltas I get can be "5 up 3 left" so I have to convert that into one "pixel" deltas like up up up left etc.
So I use the algorithm to break down the deltas into units -
So long story short, after changing the 3 to a 7 and cursing like a sailor....
Yeah.
-
You'd think that after after reading the boot sector it would be smooth sailing from there.
Yeah. No. _MountVol borked after reading part of the directory entries. This was the end of the sector so I thought there was a bug in my floppy code, but the Mac didn't ask to step to Track 1.
Hours of debugging later...
Error trying to read head 1? That should not happen, single side drive.
Wait that should be a zero.
Who sets this?
Is there a bug in my CPU?
...:meow_angry_intensifies:
-
The real MVP here is "Apple 400k Floppy Disk Drive - 6990285A.pdf", without it I'd be there for months.
(ok Mac Almanac II.txt and apple2_IWM_Spec_Rev19_1982.pdf helped too! And probably four other documents!)Thank god they gave the checksum algorithm (I need it to encode the floppy image to a format digestible by the computer)
-
Im in ur virtual floppy, reading your boot sectorz (and calculating your checksumz)
-
Well my fake Mac 128k is able to read a fake sector header on my fake floppy drive spinning a fake disk at the proper (variable) fake speed. :meow_bongo_keyboard:
PROGRESS!
-
I mean I'm *that* close to getting it, but I don't. I'm no good at bit twiddling.
Basically the chip takes a 6 bit value (0..63) and spits out a square wave with a duty cycle 0..100%.
But the relation is not linear. The computer does a weird shifting and xoring loop thing with the value... I'm sure to make the PAL chip's job easier (apparently it's just a "counter"). But I don't get it. I see a pattern but don't get how to reverse it... (hence the lookup table) Soo frustrating! -
Don't you love it when you spend all day trying to understand values and do tons of experiments and spreadsheets and tests in assembly to extract values and still can't figure out the bit twiddling at work and there is absolutely no documentation of what the PAL chip does and you finally say fuck it and build a reverse lookup table?
-
Look 'ma, I'm a hacker! :meow_bongo_keyboard:
(bypassing the Mac 128k rom checksum validation to poke some values trying to figure out how the PWM floppy motor speed routines work)
-
@grum999 I don't know if it's more complicated than an CPU...
But it's complicated because there's a lot of timing stuff that needs to happen at the right time...
Plus trying to understand old documentation.I mean, I remember the earlier floppy controller I built for the PC/XT was hell too - for a while I thought I couldn't do it.
This one is... different. I have to take a whole other approach.
Simpler in some ways.
More complicated in others.
We'll see if I figure it out. -
This means I have to emulate *everything*.
The spinny disk.
The variable motor RPM.
All the low level "move one track down" "still seeking?"And the data.
Can't return just a neat 512 bytes sector. Noooo, you have real raw sectors, with headers and checksums and weird byte encoding.
That I have to rebuild because (most) image files strip all of these.
I have to constantly "fly" the bytes under the (virtual) head because the disk goes spin. :meow_gummy_spincolors:
help!
-
I swear the Mac's floppy drive will be the death of me.
So far I've been half-faking floppies on the PC and Amstrad because when the computer uses a controller, you get a layer of abstraction.
You ask the controller "read track X, sector Y, head Z" and it does its thing and you get data.
Magic.(ok it's still complicated. The μPD765 a weird, old and ugly state machine)
The Apple II / Mac's controller (made by the Woz) does clever things. But nothing as far as abstraction.
-
Hey it was only silly old me with a bug in my video class (e.g. incrementing the memory address *before* drawing the pixels :meow_googlytrash: )
Much better. Not sure how I'm going to deal with the annoying moire effects though.
So, CPU is 80%+ implemented I guess, woot!
I'm going to focus on the Mac part for a bit probably. The floppy scares me because I can do a standard floppy controller but this one is a Woz creation, so it's probably impossible to grok for a mere human.
-
Welp probably an arithmetic bug somewhere still (the box is offset) but this is running much farther that it was yesterday.
And with that... :meow_sleep:
-
-
Here are the kinds of mistakes you make when you emulate a CPU:
- Forgot to update a flag
- Wrong register used (doh!)
- Wrong width (did a byte op but it's a word - often copy paste error)
- Borked logic (oops I thought rotate did X but it does Y)
- Behaviour of the op is unclear (What is pushed on the stack on a Line1010/1111 exception? Does the program counter point to the current instruction or the next? I had to wing it looking at how the code behaves on the other side) -
Getting a weird bug deep down in the Mac initialization routines makes me regret not taking the time to make unit test for every single freaking opcode.
Yeah that would have been very time consuming.But stepping in assembly code you don't understand looking for the moment something borks is too.
And it's probably due to a missing semicolon somewhere.
Yay software!