Articles tagged “Brass”
Various calculator-related updates: BBC BASIC, Vinegar, Telnet 83, Brass and Latenite
My original TI-83 Plus feels like it's on its last legs. I suspect there's some issue with the flash memory, and I've already had to wipe its certificate page using the BootExec utility that exploits a buffer overflow in the link routines to get an operating system back on it. Even though it's working for now, I'm somewhat wary of installing flash applications on it. Recently, however, someone contacted me to let me know that there was a bug in the TI-83 Plus version of Richard Russell's BBC BASIC that I'd put together a few years ago.
BBC BASIC Brass Graphing Calculator Latenite Telnet 83 Texas Instruments TI-83+ Vinegar Z80
Migrating SVN repositories to GitHub, maintaining history even on addition/removal of a trunk folder
Years ago I had a few projects hosted in Google Code's SVN repositories, but Google closed Code down in 2015 and though I backed the files up locally via svnsync to carry on working on the projects the code was never made publicly available again. I decided it would be a good idea to move these repositories to GitHub, but quickly ran into the problem that during the initial migration from my local repository to Google Code's repository I had been forced to move all of the code into a trunk folder (I do not generally use SVN's branching or tagging features) and attempting to synchronise from SVN to Git lost all revision history prior to that change.
Scripting
Scripting with .NET is unbelievably easy. I wanted to add scripting support to Brass, and have added it using .NET's excellent powers of reflection and its System.CodeDom.Compiler namespace. The first thing I need to do is find out which language the source script is written in. I use the extension to check for this. string ScriptFile = ...; // Name of main script file to compile. CodeDomProvider Provider = null; // Get the extension (eg "cs") string Extension = Path.GetExtension(ScriptFile).ToLowerInvariant(); if (Extension.Length > 0 && Extension[0] == '.') Extension = Extension.Substring(1); // Hunt through all available compilers and dig out one with a matching extension.
Brass 3.0.0.0 Beta 1
Brass 3 Website. I've released a beta version of the new assembler. It comes with the compiler, a GUI builder (see the above screenshot) and the help viewer; it also comes bundled with a number of plugins. I've also knocked together a quick demo project that can be built directly from Explorer once Brass is installed. There are a number of missing features (such as a project editor, project templates and multiple build configurations) and no doubt broken, incomplete or untested components - but at least it's out in the wild now, which gives me an incentive to fix it!
Brass 3 and TI-83+ Emulation
Brass 3 development continues; the latest documentation (automatically generated from plugins marked with attributes via reflection) is here. The compiler is becoming increasibly powerful - and labels can now directly store string values, resulting in things like an eval() function for powerful macros (see also clearpage for an example where a single function is passed two strings of assembly source and it uses the smallest one when compiled). Thanks to a series of hints posted by CoBB and Jim e I rewrote my TI-83+ emulator (using the SMS emulator's Z80 library) and it now boots and runs pretty well.
Brass 3
Quake isn't dead, but I've shifted my concentration to trying to get Brass 3 (the assembler project) out. Brass 2 didn't really work, but I've taken a lot of its ideas - namely the plugin system - and kept some of the simplicity from Brass 1. The result works, and is easy to extend and maintain. Last night I got it to compile all of the programs I used for testing Brass 1 against TASM successfully. I'm taking advantage of .NET's excellent reflection capabilities; one such example is marking plugin functions with attributes for documentation purposes, meaning that all you need to get Brass documentation is to drop your plugin collection assemblies (DLLs) into the Brass directory then open the help viewer app.
TI Emulation, Functions in Brass and Gemini on the Sega Game Gear
This post got me wondering about a TI emulator. I'd rather finish the SMS one first, but so as to provide some pictures for this journal I wrote a T6A04 emulator (to you and me, that's the LCD display driver chip in the TI-82/83 series calculators). In all, it's less than a hundred lines of code. The problem with TI emulation is that one needs to emulate the TIOS to be able to do anything meaningful. Alas, I had zero documentation on the memory layout of the TI calculators, and couldn't really shoe-horn the ROM dump into a 64KB RAM, so left it out entirely.
Sega Tween
No updates for a while, I'm afraid - things have been pretty hectic. I packaged up and released the Sega Tween demo I'd been working on. As you can see, I added an SMS and a 3D mode - this works with the SMS 3D glasses. The extra 3D is quite cheap to calculate - shift the rotated X coordinates one way for one eye, then the other way for the other eye. After projection to the screen they need to be shifted back a little way to re-centre, but it works quite well. However, I had neglected the fact that the SMS1 (which has the card slot, and hence the model that supports the 3D glasses) had a bug in the VDP and as such only supports four zoomed sprites per scanline.
It lives..!
Thanks for the support, MrEvil, and thanks for noticing my rather dead tutorials section, linkofazeroth. Sadly, I've been horribly busy recently - and so very little progress on any project. However, Brass 2 is starting to come together... Can you guess which device the code is for? Well, it'll never be an IOTD, but it's something. With the syntax fixed, it does actually work (and outputs a valid binary). I've been trying to work out the syntax used (with valuable input from CoBB over at MaxCoderz).
Latenite and Brass 2
Both Latenite and Brass are getting a significant upgrade - and both are being written from scratch. Both will sport a plugin-based architecture. This is most obvious with Brass - where pretty much everything - be it an assembler plugin or output plugin - can be extended by writing your own custom plugins. All Brass does is parse the basic syntax and pass it to the various plugins to work out what to do with it! Latenite will load Brass and use it to provide feedback - such as error reporting and syntax highlighting - directly to the user.
Stuff and nonsense
Brass
Important: all versions ≤ 1.0.4.5 have a major bug with ZIDX instructions (eg rr (ix+1)) meaning that they are not output correctly. Please upgrade to 1.0.4.6 as soon as possible. Other stuff
I haven't had much of a chance to do anything especially exciting of late. I found my PICAXE chips and also found out the reason that one of them never seemed to work was that I was using an old version of the programming software and the chip was an 18X, not a regular 18 (so lots of extra space - can only be a good thing).
Applications
I've been attempting to add native TI-83+/TI-73 application support to Brass. Testing with Flash Debugger has been an entertaining experience, not least thanks to helpful messages like:
I haven't managed to get a signed application running in Flash Debugger or on hardware yet - I suspect the header is wrong - but seeing as the demo application has a different header structure to what the header generator creates, and both have generally conflicting information, I need to find some better resources.
Debugging fun
One part of the Latenite 'suite' that's needed some dire attention is the PindurTI interface. This talks to the excellent TI emulator via a non-interactive mode, and can therefore sit between Latenite (and your source code) and the emulated calculator (which is running your binary). The current incarnation of this tool is very primitive - you have a calculator that you can run/pause and send files to. That's it. A picture should illustrate what the new one's like and what the old one was missing:
There's a memory viewer, register viewer, and breakpoint window.
Patch files
I added Emukon patch file export to Brass - Brass will export all the labels, variables and breakpoints from the source and Emukon can then load them in. It makes debugging much simpler... Click for legible In my Game Gear-related fiddling, I optimised the tween demo code significantly, but then slowed it back down again by adding 4 more points, extending the rotation code to using 16.16 rather than 16.8 fixed-point and using a proper linear tween. It's still a bit smoother, though:
Video: 00'58" WMV [1007KB]
Structs and sensible variable layout
When developing an assembly program, you need to 'declare variables' by attaching an address (in RAM) to a label. The problem here, of course, is having to calculate all the relevant positions in RAM for each variable. For example,
ram = $C000 ; Assume RAM starts at address $C000 var1 = ram+0 var2 = ram+1 var3 = ram+3 ; var2 is 2 bytes! ; ... and so on ... Now this is fairly painful. So, I added .varloc and .var directives to Brass:
ram = $C000 ; Assume RAM starts at address $C000 .varloc ram, 1024 ; 1024B in size .var 1, var1 .var 2, var2 .var 1, var3 ; ...
Further Brass development
One of my ongoing projects is Brass, a Z80 assembler. The newest release adds all sort of goodness, especially nested modules - for example: .nestmodules .local .module Animals .module Cat Legs = 4 .endmodule .echo "Humans have ", Human.Legs, " legs.\n" .module Human Legs = 2 .module Brother Age = 17 .echo "My sister is ", Animals.Human.Sister.Age, " years old.\n" .endmodule .module Sister Age = 21 .global Arms = 2 .endglobal .endmodule .endmodule .module Spider Legs = 8 .echo "A spider has ", Legs,...
YM2413 (OPLL) Emulation
As (yet another) side project to all this Z80 work, I've also decided to have a stab at the Japanese Master System's FM chip. It's a YM2413, and the documentation on it is fairly tricky to get to grips with - not only thanks to it being in typical Japanese-manual English. So far, I have this - the VGM player is a bit buggy and extremely primitive (unfinished), but should be enough to demonstrate the current state of the OPLL. You'll need an FM VGM to try it with - the Space Harrier demo from the BIOS sounds pretty good.
TI Z80 Development Gets Cool
This excites me greatly - integrating a debugging emulator into Latenite is very, very awesome. CoBB's emulator is incredibly good as a standalone, being able to step through your code instruction-by-instruction with breakpoints and a watch window or two is just amazing! I spent most of the last few days working on Brass - adding for loops to assemble blocks of code multiple times and a few file operations for people not happy with the behaviour of .incbin. I also remembered to release an XML help file for Latenite.
Intelligent macro-matching, VS icon nicking
Brass has got a new macro preprocessor, that hopefully makes the work of people writing things like the macro-driven TI ASM API easier, and will generate less redundant code.TASM only supports simple find-and-replace macros; so, for example:
#define draw_sprite(x,y,sprite) ld a,x\ ld b,y\ ld hl,sprite\ call put_sprite draw_sprite(10,43,my_sprite) ; Generates the following: ld a,10 ld b,43 ld hl,my_sprite call put_sprite draw_sprite(a,43,hl) ; Generates the following: ld a,a ; Rubbish!
Business with the Z80
I have been pretty busy with Brass and Latenite over the last few days - Latenite has had a few little adjustments/improvements/fixes, but also has a few new holes in it which means that it is unsuitable for release. I'm adding the ability to hook help files to projects rather than each project being loaded with every help file - this has the extra bonus that Brass will be able to compile help files straight from the source, which will then be reloaded on each build by Latenite. I did something unheard of over the weekend as well - I read the SDK manual for the TI-83 Plus.
It lives!
A public release of Brass has been released... it can assemble some rather nasty Z80 code (TASM macro-abusing code, that is!) fine. Hopefully people can start finding the parse errors, or just complain at the horrible colour scheme of the manual. And why did nobody tell me you could access the LSB/MSB of IX/IY through IXL/IXH/IYL/IYH before? @kwijibo: You can use a Latenite beta if you take this file then unzip this file on top of it. It is almost entirely data driven - all Z80 registers (that I knew about) and flags (likewise) are hard-coded (but not Z80 instructions).
BRASS
One logical step up for Latenite is to not have to be bundled with a 3rd party assembler.Mainly because one (high profile!) user is having real problems getting the buggy TASM to work with it, and other people have expressed annoyance with TASM, (limited string length, limited label length, limited numbers of DBs, lack of features, buffer overflow crashes... the usual) I have decided that I need to write an assembler (BRASS).WLA-DX is very nice but is geared towards console development and burning programs on ROMs, and defining a ROM bank map for a TI-83 Plus program is a bit silly.





















