Skip to content

Commit

Permalink
-homebrew/linux4004.cpp: Emulated Linux/4004 board.
Browse files Browse the repository at this point in the history
* VFD is not emulated, but all other features are present.

-machine/sc16is741.cpp: Emulated basic SC16IS741A UART functionality in
 SPI interface mode.

-macine/spi_sdcard.cpp: Improved interface logic:
* Start in unprotected mode as specified by the standard.
* Ignore stop bits in unprotected mode - apparenty real cards do this.
* Set protected or unprotected mode in response to CMD59.
* Reset SPI logic when initially selected.

-machine/spi_psram.cpp: Started adding PSRAM QPI functionality.

-emu/diserial.cpp: Got rid of the per-instance parity lookup table.

New working systems
-------------------
Dmitry Grinberg Linux/4004

New working software list items (lnux4004.xml)
----------------------------------------------
uMIPS Linux 4.4.292+
  • Loading branch information
cuavas committed Oct 4, 2024
1 parent 3a7d725 commit aeaf19f
Show file tree
Hide file tree
Showing 13 changed files with 2,027 additions and 118 deletions.
20 changes: 20 additions & 0 deletions hash/lnux4004.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
<!--
license:CC0-1.0
-->

<softwarelist name="lnux4004" description="Linux/4004 SD Card images">

<software name="linux">
<description>uMIPS Linux 4.4.292+</description>
<year>2024</year>
<publisher>Dmitry Grinberg</publisher>
<part name="linux4004" interface="sdcard">
<diskarea name="harddriv">
<disk name="linux4004" sha1="6458018636d21845c95e1076b81c615e16a97975" writeable="yes" />
</diskarea>
</part>
</software>

</softwarelist>
11 changes: 11 additions & 0 deletions scripts/src/machine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3320,6 +3320,17 @@ if (MACHINES["SAA5070"]~=null) then
}
end

---------------------------------------------------
--
--@src/devices/machine/sc16is741.h,MACHINES["SC16IS741"] = true
---------------------------------------------------
if (MACHINES["SC16IS741"]~=null) then
files {
MAME_DIR .. "src/devices/machine/sc16is741.cpp",
MAME_DIR .. "src/devices/machine/sc16is741.h",
}
end

---------------------------------------------------
--
--@src/devices/machine/scc66470.h,MACHINES["SCC66470"] = true
Expand Down
Loading

2 comments on commit aeaf19f

@cuavas
Copy link
Member Author

@cuavas cuavas commented on aeaf19f Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This system is sure to teach you patience. Remember video is a bottleneck in MAME, so if you want to maximise the speed it runs at, use options something like:

window          1
maximize        0
throttle        0
frameskip       10
video           bgfx

With a non-debug build, you can get over 3000% speed (thirty times speed) on a fairly modest notebook computer, so it doesn’t take days to boot.

Keep in mind that when running unthrottled, the emulated terminal’s key repeat (“typematic”) will run at an insane rate, so when you want to actually type a command, you should hit F10 to throttle to normal speed, type the command, then hit F10 to turn throttling off again and watch it slowly echo and run the command. The UART has a 64-byte FIFO, so you can get a few short commands in without having to wait for it to catch up.

You can also use the null_modem emulated serial device and connect to it with a socket to avoid the issues with the emulated terminal running fast.

It’s configured with 12 MiB of RAM for the emulated MIPS system (8 MiB plus 4 MiB). Changing this requires editing the source and recompiling. Changing the number of 4002 chips installed for the MIPS TLB can be done from the Machine Configuration settings, and takes effect on reset (you can also add an extra 4002 at 01:c0-ff which the firmware won’t use, but you might want it if you’re writing your own firmware).

If you’re looking at the contents of MIPS RAM in the debugger (“Generic SPI/QPI Pseudo-SRAM/:u5/0/m_ram” and “Generic SPI/QPI Pseudo-SRAM/:u6/0/m_ram”), be aware that data is stored in little Endian byte order with nybbles swapped (e.g the word value 0x012345678 will be stored as 87 65 43 21). This is because the 4004 works in nybbles and the SPI RAM transfers bytes MSB-first. The 4004 transfers a word one nybble at a time, from least significant to most significant. Each pair of nybbles occupies one byte in RAM. Since the least significant nybble in each pair is transferred first, it occupies the most significant nybble of the byte in RAM.

@cuavas
Copy link
Member Author

@cuavas cuavas commented on aeaf19f Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obligatory screenshot:
Image

Please sign in to comment.