modemwars/disassembly/boot/titleColorRam9800.s
2026-08-23 02:09:40 -05:00

95 lines
13 KiB
ArmAsm

; ============================================================================
; LOAD ($9800-$9BFF) - title picture colour RAM (1000 bytes, copied to $D800 by $C23F)
; ============================================================================
; Low nibble = colour 3 of each 4x8 multicolour cell. Bytes $9BE8-$9BFF are padding.
.setcpu "6502"
.include "c64.inc"
.include "kernal.inc"
.include "zeropage.inc"
.org $9800
; titleColorRam - colour RAM of the title picture: 1000 bytes = 25 screen rows of 40 cells, one screen
; row per line below (rows 0, 2 and 3 are split where a foreign label lands inside them). Source: the
; first 1000 bytes of the directory file 'load' ($9800-$C3FF, 45 blocks on tracks 19-21),
; KERNAL-loaded by eaLoadGame ($02B8) before it calls the boot loader at $C000. The one piece of code
; that reads it is bootShowTitlePicture: the self-modifying loop at $C271 copies four whole pages,
; $9800-$9BFF to $D800-$DBFF, and the code after it sets $D016 = $D8,
; $D018 = $38 and $D011 = $3B - multicolour bitmap, VIC bank 2, video matrix $8C00 (filled from
; titleScreenRam $9C00) and bitmap $A000 (titleBitmapA000). In multicolour bitmap mode the low nibble
; of a colour-RAM byte is the colour of every %11 pixel pair in that 4x8-pixel cell; %01 and %10 take
; the high and the low nibble of the $8C00 byte and %00 takes the background $D021, which bootMain set
; to black at $C14E. The high nibble is 0 in all 1000 bytes (the VIC ignores it anyway), so the values
; run $01-$0F. Every one of the 1000 cells contains at least one %11 pixel pair (checked against the
; bitmap at
; $A000), so there is no don't-care byte in this table - each one is visible on screen. The artist
; drew the big flat areas in %11, which is why the sky ($0E), the field ($05), the smoke greys and the
; yellow copyright line ($07) are all coloured from here; the DAN BUNTEN'S line at the top is the one
; large feature that is not - it is %01 pixels taking the high nibble of the $8C00 byte. Colours used,
; by frequency: $0E light blue 236 (sky), $02 red 182 (the MODEM WARS logo), $0B dark grey 162, $0F
; light grey 113, $0C mid grey 55 (the walker, the smoke), $05 green 105 (the field),
; $01 white 83, $07 yellow 37 (the two text lines), $09 brown 21 (hills and debris), $08 orange 5,
; $0A light red 1. Black, blue, cyan, purple and light green never occur.
; The block is dead the moment the loader pulls track 28 s0-12 over $9300-$9FFF; the picture stays on
; screen because the VIC is reading the copies in $D800 and $8C00 and nothing touches the bitmap at
; $A000 until the game starts drawing. docs/titleScreen.png is this picture decoded. At run time these
; same addresses belong to game/graphicsData9300 (glyph tables and the two console fonts), which is
; why labels from that unit appear in the middle of the rows below and why a row here may be broken in
; two where that unit declares a data type of its own.
titleColorRam:
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E; 9800 ................ row 0 cells 0-15 - open sky, drawn with %11 pixels so $0E is the sky itself; the yellow DAN BUNTEN'S letters are %01 pairs
; $9810 is not the start of anything in the title picture - it is cell 16 of screen row 0. The label
; is here only because the same address in the run-time image is tallDigitGlyphPairTable in
; game/graphicsData9300 (read by drawTallGlyph at $2BBA/$2BC5), and a label applies to every unit that
; covers the address. The same goes for $985E and $987E below.
titleColorRow00Cell16:
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$02,$0C,$0C,$0F,$0F,$0F,$0F,$0F,$0F,$0F,$0F,$0F,$0B,$0C; 9810 ........................ row 0 cells 16-39 - end of the DAN BUNTEN'S line, dark red debris streak at 26, then the smoke cloud
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0F,$0F,$0F,$0C,$0C,$0F,$0F,$0F,$0B,$0C,$0B,$0B,$0B; 9828 ........................................ row 1 - sky out to cell 26, smoke cloud greys 27-39
.byte $0E,$02,$02,$0E,$02,$02,$02,$02,$02,$02,$02,$02,$0E,$02; 9850 .............. row 2 cells 0-13 - top of the red MODEM WARS logo, sky showing between the letters
; Cell 14 of screen row 2. Stale label: at run time $985E is the biased base through which the
; chat-line editor ($C80A) indexes asciiToGlyphTable in game/graphicsData9300.
titleColorRow02Cell14:
.byte $02,$02,$02,$02,$0E,$02,$02,$0E,$02,$02,$02,$02,$02,$02,$02,$02,$0C,$02,$02,$02,$02,$0B,$02,$02,$02,$0B; 985E .......................... row 2 cells 14-39 - logo continues; the smoke cloud cuts grey into it from cell 30
.byte $01,$02,$02,$0E,$02,$02 ; 9878 ...... row 3 cells 0-5 - white muzzle flash at the left edge (cell 0) and the M of MODEM
; Cell 6 of screen row 3. Stale label: at run time $987E is asciiToGlyphTable, read by printChar at
; $C02A in the $C000 text engine. XREF also lists 'from boot/fastLoaderC000: r:C02A' for this
; address, but $C02A in the boot loader is the 'dec ldCount' inside bootLoadSectors - that reference
; really belongs to the text-engine overlay, which shares the $C000 addresses with the loader.
titleColorRow03Cell06:
.byte $02,$0E,$02,$02,$02,$02,$02,$02,$0E,$02,$02,$02,$0E,$02,$02,$0E,$02,$02,$02,$02,$02,$0C,$02,$02,$0C,$0C,$02,$0B,$02,$02,$02,$0B,$02,$0B; 987E .................................. row 3 cells 6-39 - body of the logo, greys where the smoke crosses it
.byte $0E,$07,$01,$01,$01,$02,$02,$0E,$02,$02,$02,$02,$02,$02,$02,$0E,$02,$02,$02,$02,$02,$0C,$02,$02,$02,$02,$02,$02,$02,$02,$0F,$0F,$02,$02,$02,$0B,$02,$02,$02,$0B; 98A0 ........................................ row 4 - the muzzle flash burns yellow/white over the logo at cells 1-4
.byte $0E,$08,$07,$01,$01,$02,$02,$0E,$02,$02,$02,$02,$02,$02,$02,$0E,$02,$02,$02,$02,$02,$0C,$02,$02,$02,$02,$02,$02,$02,$02,$0B,$0B,$02,$02,$02,$0B,$02,$02,$02,$02; 98C8 ........................................ row 5 - flash core: orange 1, yellow 2, white 3-4
.byte $0E,$0E,$02,$07,$01,$0F,$01,$0E,$02,$02,$02,$02,$02,$02,$0E,$02,$02,$02,$02,$02,$02,$0F,$02,$02,$02,$02,$0C,$02,$0B,$02,$02,$0B,$02,$02,$02,$02,$02,$0B,$02,$02; 98F0 ........................................ row 6 - flash fading (yellow/white 3-6), logo, smoke greys from 26
.byte $0E,$02,$02,$02,$02,$02,$0B,$0F,$0F,$02,$02,$02,$0E,$02,$02,$02,$02,$02,$02,$02,$02,$0C,$0C,$02,$02,$02,$0C,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$0B; 9918 ........................................ row 7 - bottom row of the logo; the walker gun barrel is the light grey pair at 7-8
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0F,$01,$01,$0E,$0E,$0E,$0E,$0E,$0E,$0F,$0F,$0C,$0C,$0C,$0C,$0C,$0B,$0B,$0B,$0C,$0C,$0B,$0B,$08,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B; 9940 ........................................ row 8 - sky, gun barrel (light grey/white 8-10), the walker back and the smoke column; orange 31 is the top of the fireball
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0F,$0E,$0E,$0E,$0E,$0E,$0F,$0C,$0B,$0C,$0C,$0C,$0C,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$08,$0B,$0B,$07,$0F,$0B,$0B,$0B; 9968 ........................................ row 9 - barrel at 11, shoulder greys 17-23, hull 24-31, first fireball yellow/orange at 32 and 35
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$01,$01,$01,$0C,$0F,$0F,$0F,$01,$0F,$0F,$01,$01,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$07,$0B,$0B,$07,$0B,$0B,$07,$02; 9990 ........................................ row 10 - barrel white 11-13, cab top 14-22, hull 23-31, fireball yellow at 32/35/38 and red at 39
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0F,$0F,$0F,$0B,$0B,$0F,$0C,$0F,$0F,$0F,$0F,$0F,$01,$01,$0F,$0B,$0B,$0B,$0B,$0B,$0B,$02,$0B,$07,$01,$01,$02,$0F,$0F,$07; 99B8 ........................................ row 11 - barrel 10-12, cab and hull 13-30, explosion red/yellow/white 31-39
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0B,$0B,$0F,$0F,$0C,$0F,$0F,$0F,$0F,$0B,$0B,$0F,$0F,$0F,$0C,$0C,$0B,$0B,$0B,$0B,$0B,$0E,$07,$02,$01,$01,$09,$0F,$07,$0B; 99E0 ........................................ row 12 - cab and hull 10-30, explosion 32-39 with the first brown debris at 36
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0C,$0F,$0F,$0C,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0C,$0B,$0C,$0F,$0E,$0E,$0E,$0E,$0E,$01,$01,$01,$01,$01,$01,$0A,$07; 9A08 ........................................ row 13 - the hull (greys 7-26), sky 27-31, fireball white 32-39; cell 38 ($9A2E) is the only light red byte in the picture
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0C,$0F,$0F,$0C,$0B,$0B,$0B,$0B,$0B,$0B,$0C,$0C,$0B,$0C,$0B,$0B,$0B,$0B,$0C,$0F,$0E,$0E,$0E,$02,$02,$08,$01,$01,$01,$01,$07,$07,$07; 9A30 ........................................ row 14 - hull greys 7-26, sky 27-29, explosion red/orange/white/yellow 30-39
.byte $0E,$0E,$0E,$0E,$0E,$0F,$0F,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0F,$0B,$0B,$0F,$0F,$0F,$0F,$0F,$0F,$0B,$0B,$0C,$0F,$0E,$0E,$0E,$01,$09,$01,$0F,$01,$01,$01,$01,$01,$0F; 9A58 ........................................ row 15 - the second, smaller walker at the left (5-16), the hull above the legs (17-26), blast whites 30-39
.byte $0E,$0E,$0E,$0E,$0F,$0F,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0F,$0F,$0B,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0C,$0F,$0E,$0E,$0E,$01,$0F,$0F,$01,$01,$01,$01,$07,$0F; 9A80 ........................................ row 16 - the left walker 4-16, sky 17-25 between it and the main walker leg at 26-27, blast 31-39
.byte $0E,$0E,$0E,$0E,$0C,$0F,$0F,$0F,$0F,$0F,$0F,$0B,$0E,$0E,$0E,$0E,$0B,$0F,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0C,$0F,$0E,$0E,$0E,$0F,$0F,$0F,$01,$01,$09,$09,$0B; 9AA8 ........................................ row 17 - left walker greys 4-17, main walker leg 27-28, brown debris 37-38, sky elsewhere
.byte $0E,$0E,$0E,$0C,$0B,$0B,$0B,$0B,$0B,$0B,$0B,$0E,$0E,$0E,$0E,$0E,$0B,$0B,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0C,$0B,$0E,$0E,$0B,$08,$0F,$0F,$09,$09,$09,$0F; 9AD0 ........................................ row 18 - legs at 3-10, 16-17 and 28-29; brown ground and debris 32-38
.byte $0E,$0E,$0E,$0B,$0B,$09,$0B,$0B,$0B,$0C,$0B,$0F,$0E,$0E,$0E,$01,$0B,$0B,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$09,$09,$0F,$0F,$09,$09,$09,$09,$01,$09,$0F,$0F,$09,$09,$09; 9AF8 ........................................ row 19 - the horizon: brown hills from cell 25 on, dark grey legs, the last sky cells
.byte $05,$05,$05,$0B,$0B,$05,$05,$0B,$09,$05,$05,$05,$0F,$05,$01,$01,$0B,$0C,$05,$05,$05,$05,$05,$05,$05,$09,$01,$01,$0F,$05,$05,$05,$09,$05,$01,$01,$0F,$05,$05,$05; 9B20 ........................................ row 20 - the green field starts; white/grey legs and feet, brown patches at 8, 25 and 32
.byte $05,$05,$05,$0B,$05,$05,$01,$0B,$05,$05,$05,$01,$0F,$01,$01,$01,$0B,$05,$05,$05,$05,$05,$05,$05,$05,$01,$01,$0F,$0F,$05,$05,$05,$05,$0F,$01,$01,$0F,$05,$05,$05; 9B48 ........................................ row 21 - field with the walkers' legs and feet
.byte $05,$05,$05,$05,$05,$05,$01,$0B,$05,$05,$05,$01,$01,$01,$01,$0B,$0F,$05,$05,$05,$05,$05,$05,$05,$05,$01,$01,$01,$0C,$05,$05,$05,$01,$0B,$01,$0B,$05,$05,$05,$05; 9B70 ........................................ row 22 - field and feet
.byte $05,$05,$05,$05,$05,$01,$07,$07,$07,$07,$07,$07,$07,$07,$01,$0B,$0B,$05,$05,$05,$05,$05,$05,$05,$07,$07,$07,$0B,$07,$05,$05,$05,$07,$05,$07,$07,$07,$05,$05,$05; 9B98 ........................................ row 23 - COPYRIGHT (C) 1988 OZARK-SOFTSCAPE in yellow over the green field
.byte $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0F,$01,$01,$01,$01,$0C,$0F,$0C,$07,$07,$07,$05,$01,$01,$0F,$01,$01,$0B,$0F,$0C,$05,$05,$05,$05,$05,$07,$07,$0B,$0B,$0F; 9BC0 ........................................ row 24 - bottom half of that line, the feet, and a small dark grey 'mk' at cells 37-38 (the artist's initials?)
; titleColorRamPadding - the last 24 bytes of the 1024-byte block, after the 1000 screen cells.
; bootShowTitlePicture copies four whole pages, so these bytes do reach colour RAM at $DBE8-$DBFF,
; past the 1000 cells the VIC fetches: they are copied but never displayed, and no code reads them.
; The pattern is an alternating $00/$FF dither. The matching 24 bytes at the end of the screen-RAM
; block ($9FE8) are its exact bit-complement except for one byte ($9BF4 = $FF against $9FF4 = $0B),
; and the sequence occurs nowhere else in the file, so this is probably the tail of a shape/mask pair
; left in the artist's tool when the picture was saved, not data of any kind.
titleColorRamPadding:
.byte $00,$FF,$00,$FF,$FF,$FF,$00,$FF,$FF,$00,$FF,$00,$FF,$00,$FF,$00,$FF,$00,$FF,$00,$FF,$00,$FF,$00; 9BE8 ........................ 24 bytes past the last cell of the picture