Regnerator Booster

- Note this app is not associated with, supported by or developed by Tom-Cat -

This will need the VS2013/.net 4.0 runtimes to work

To start with you need to save your Regenerator project so you have the config file and a tas file. Once you have do this, use Open Confiq and select the Regenerator config file, and then Open VSF and open the same VSF file you used to make the Regenerator project.

Refresh Config – This can be used to update the confiq file if you have made changes and saved in regenerator.
Save Config – Saves the config file so you can reopen the vsf and  see your changes in Regenerator

Do RTS to EXITXX – This needs to TAS file and will ask for it when clicked. This will scan through the code and find all
label       RTS
and add a label to the confiq file that replaces the label above with EXITXX where XX is an incrementing number. Personally I find it easier to understand the code when I know a branch or jump is actually to an RTS, saves me having to look it up and name it. (only modifys auto labels)


Data Vars


Var  Base Name – This is the name of label to use, it will have the extra data appened to it. So MainScreen, Font etc
Base Address - This is a hex address without the $, this is the start address, so for the standard 64 screen you would write 400
Do Screen Setup – This needs the TAS file again and will ask for it. This will calculate line and chars offsets from the Var Base Name. So if there is a label at Base Address it will make the label become Var Base Name_Line0_0 ( line 0 char 0 ) etc, this means you can see if code is plotting to a certain part of the screen easily. It will also add the sprite pointers as Var Base Name_SprIDX where X = 0 -7 (only modifys auto labels)
Do Charset Setup – This needs the TAS file again and will ask for it. This is like the screen but it sets the labels based on a Charset. Var Base Name_CharXXX_Y where X is the char number 0-255 and Y is the row in said char (only modifys auto labels)
Do CRAM setup – This needs the TAS file again and will ask for it. This does the same as Do Screen Setup but is hard coded to start at D800 and uses the label base of CRAM so CRAM_ROW0_0 etc (only modifys auto labels)

VIC  lookups


These will scan through memory and look for patterns like

LDA #XX
STA D0XX
LDA D0XX
AND #YY
STA D0XX
LDA D0XX
ORA #YY
STA D0XX
LDA D0XX
AND #YY
ORA #ZZ
STA D0XX

It will handle A,X,Y variants.  It will add register specific comments on the LDA,AND or ORA lines to show what the lines does.
For example
$19B4: AD 11 D0 LDA $D011    ;VIC Control Register 1
$19B7: 29 BF    AND #$BF    
$19B9: 8D 11 D0 STA $D011    ;VIC Control Register 1
$19BC: 60       RTS

Will become
$19B4: AD 11 D0 LDA $D011    ;VIC Control Register 1
$19B7: 29 BF    AND #$BF     ;Clear ExColTextMode,Y Scroll 0
$19B9: 8D 11 D0 STA $D011    ;VIC Control Register 1
$19BC: 60       RTS

Addresses that are enable bits like D015 for example will have a comment made with the binary string %00001100. Colour registers, D020 for example, will have a comment on the colour so 1 will get a comment of white for example.

You can click on each number to just do that register or ALL to scan and do all of them. The All is not intelligent and just does one button press after another. It will take a while to complete and there is no progress bar, just wait, it is working.
01 – This does what the VIC commands do but looks up $1 and put the resulting memory map in comments (doesn’t care about Cassette port values )
$3F5F: A9 24    LDA #$24     ;PURE RAM
$3F61: 85 01    STA a01

Pointer Tables


This if for handling cases in data that are actually pointers. The standard mode is HI LO table like so
$A4DE: pmdSourceLoLUT        .BYTE $E9,$16,$34,$40
$A4E2: pmdSourceHiLUT        .BYTE $A4,$A5,$A5,$A5

Addresses(lo) - This is the address of the LO half of the Table ( or table if in Hi Lo Mode ) (hex address without the $)
Hi – This is the address of ht HI half of the Table ( not needed in Hi Lo Mode )
Size – This is the number of entries in the table to look up
Calc Size Hi Lo – If the Hi is directly after the Lo you can press this button and the app will do the Maths for you.
Lo Hi Mode – When ticked it will expect the table in Lo Hi Words so the above table would be .BYTE $E9,$A4,$16,$A5,$34,$A5,$40,$A5
Label Table – This will look up the table, build the final address and add a label tXXXX for the address in the table. (Asumes that the pointers are not detected by Regenerator)

Data Comments


This will makes comments that “show” the design of a sprite or char. Well they would if there wasn’t a bug in Regenerator that means comments don’t show on Data lines. But it handy to have a quick look at some data to see if it a sprite or part there off. Also if a sprite is modified in code this will give you a Sprite_ROWX label to look up in the code.
Address – Location to start (hex address without the $)
Label Base – The label base for the Sprite, it will become the format Base_ROWX
Sprite Preview – This will show the sprite at the address specified in ASCII in the preview pane
Char Preview - This will show the char at the address specified in ASCII in the preview pane
Colour – This is the ASCII char to use when it needs to show the Sprite/char colour
Multi Colour – Is the sprite or char in mono or Multi colour mode
Multi 1 – The ASCII char to use when it needs to show the 1st multicolour colour
Multi 2 – The ASCII char to use when it needs to show the 2nd multicolour colour
Sprite to Config – Commits the sprite to the confiq file
Char to Config – Commits the char to the confiq file


Special Comments


This is like the VIC lookups but sometimes the value that is stored is not direct. Somewhere puts the value in ZP and then the IRQ reads that ZP and writes it to the VIC. In this case you can enter the address of the Opcode and it will then treat the param as if it was to be stored into the address you want.
Binary – Make a comment with the binary string of the value
Colour – Look up the colour number to the name
D011 – Comment as a D011 LDA value
D016 – Comment as a D016 LDA value
D018 – Comment as a D018 LDA value
01 – Comment as a 01 LDA value


Blocks


This doesn’t really work as well as I would like but still kinda works. This lets you pull a block from the screen memory and then it will hunt RAM for that sequence to make it easier to find where the blocks are stored in RAM
Screen Addr – This is where the screen you want to rip from is (hex address without the $)
X Offset – During the grab the blocks might not be aligned with the top of the screen, this shifts the stat X
Y Offset – During the grab the blocks might not be aligned with the top of the screen, this shifts the stat Y
X Size  - This is the number of chars the block is wide
Y Size – This is the number of chars the block is high
X Count – This was to be the number of tiles that fit on the screen across (must be complete tiles)
Y Count – This was to be the number of tiles that fit on the screen high (must be complete tiles)
Find Block – This will pull the blocks and put the addresses it finds them into the box on the right.
Block Ranges? – This will hunt for the blocks, it if only finds 1 sequence in RAM for it it counts it, then it looks at the min and max and has a guess of the memory range of the blocks. Grain of salt .

Export HTML


This will export a HTML “documentation” of the code.
There are special commands that you can put in Line Comments to help it build the table
@CODE:WWW:Comment – Where

WWW can be AXY where the function trashes those registers remove as not needed, eg
@CODE:A:This only uses A
@CODE:XY:This only uses XY, and does a thing

It will pull the function name from the Label from the next line.

@END will close off a @CODE block, a new @CODE will also start a new one, so if you have
@CODE:AXY:Something
//code///
@CODE:A:Another thing
//code//
@END
Data segments can be added with
@DATA:size:comment
Since DATA has a size it doesn’t need an end. The @ commands can be chained on a line so you can do
@END @DATA:8:LUT for the above code
When this is output to a html file it will make a table like so
It makes a DATA table first


Offset

Size

Name

Description

10DB

6

copyright_spr_ptr

sprites to make the copyright sprites on the title page

10E1

12

copyright_spr_pos

X,Y

12C8

45

SFXtoVoiceLUT

X from Sound Lookup Table to SID voice

12F5

45

SFXtoPriorityLUT

X from Sound Lookup Table to sound priority, higher overides lower

Then a Code table


Offset

Size

Name

Effect Registers

Notes

1081

0032

pltLoadingScreenCRAM

AX

The sets the CRAM data for the loading screen. Assumes CRAM is all white to start with.

10B3

000E

invert1x1font5000

AX

when then font char set is at $5000 this will invert the 1x1 font, used for theo screen.

Graphics can be added using the ( they will be converted into SVG and added to a table at the end)
@SPRSET:NAME=????[:MODE=MONO/MULTI/MONOMULTI/MULTIMONO:COL=C:MCOL1=C:MCOL2=C:MULTIC=C]
Where [ ] are optional.
??? = is the name of the set, where each set is in its own table in the HTML file
MODE = default is MONO, MULTI renders a multicolour sprite, MONOMULTI renders a mono sprite then a multicolour sprite then a mono then multi etc MULTIMONO is the opposite, Multi sprite then Mono Sprite
C = VIC colour
COL = This is the colour of the sprite, or the mono sprite in MONOMULTI
MCOL1 = This is the first multi colour of the sprite
MCOL2
= This is the second multi colour of the sprite
MULTIC = This is the colour of the multi sprite in the MONOMULTI Mode, so you typically have an outline of Black and a custom sprite colour, this sets the other colour
This forms a State Machine, so values when set carry on to the next lines, this lets you set up the multi colours once and then they are used until they are changed again.
@SPREND is used to close of the last sprite set


You can also include charsets, this is rendered in a 16x16 grid
@CHARSET:NAME=???:MODE=MONO/MULTI: COL=C:MCOL1=C:MCOL2=C
??? charset name
MODE
= Mono or Multicolour set
COL = This is the colour of the sprite, or the mono sprite in MONOMULTI
MCOL1
= This is the first multi colour of the sprite
MCOL2 = This is the second multi colour of the sprite
@CHAREND is used to close a charset

NOTE colours are shared across Sprites sets and Char sets, so if you change it in one, you change it in both going forward.

41C0 : 07 4200 : 08
Sun

Sad

SprSet


This is a helper for the above
ADDR – This is the address to start (this will get auto incremented for you) (hex address without the $)
Count – This is the number of sprites in the set
Mode – Select from the drop down, see above for details
Name – Set name
Col,Mul1,Mul2,Col Multi – Tick to show that it needs to be updated on this row, colour is the new colour to set
Add + Adv – This will add the line comments to the system and add 64*Count to Addr