Skip to content

Commit

Permalink
1.2.3: fix #85, #71, #84
Browse files Browse the repository at this point in the history
  • Loading branch information
BartmanAbyss committed Oct 23, 2021
1 parent 0ceb128 commit da75e60
Showing 5 changed files with 29 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,12 +2,17 @@

All notable changes to the "amiga-debug" extension will be documented in this file.

## 1.2.3
- fix incorrect blitter size (broken since 1.2.1) #85
- fix palette/copper colors (broken since a while) #71
- Updated to WinUAE 4.9.0 beta 38 (2021.10.23) #84

## 1.2.2
- fix multi-frame profile screenshot thumbnails (broken since 1.2.1 for 32-bit machine models)
- fix multi-frame profile error message "Unable to start profiling: RangeError: start offset of Uint16Array should be a multiple of 2" (broken since 1.2.1)

## 1.2.1
- Updated to WinUAE 4.9.0 (2021.10.14)
- Updated to WinUAE 4.9.0 beta 37 (2021.10.14)

## 1.2.0
- Updated to GCC 11.2.0 and GDB 12.0.50.20211014-git
Binary file modified bin/winuae-gdb.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"repository": {
"url": "https://github.com/BartmanAbyss/vscode-amiga-debug"
},
"version": "1.2.2",
"version": "1.2.3",
"license": "GPL-3.0-or-later",
"engines": {
"vscode": "^1.46.0"
4 changes: 2 additions & 2 deletions src/client/debugger/resources.tsx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { IProfileModel } from '../model';
declare const MODELS: IProfileModel[];

import { CustomRegisters } from '../customRegisters';
import { GetCopper, GetMemoryAfterDma, GetPaletteFromCustomRegs, IScreen, GetScreenFromCopper, GetPaletteFromMemory as GetPaletteFromMemory, GetPaletteFromCopper, BlitterChannel, NR_DMA_REC_VPOS, NR_DMA_REC_HPOS, GetCustomRegsAfterDma, CpuCyclesToDmaCycles } from '../dma';
import { GetCopper, GetMemoryAfterDma, GetPaletteFromCustomRegs, IScreen, GetScreenFromCopper, GetPaletteFromMemory, GetPaletteFromCopper, BlitterChannel, NR_DMA_REC_VPOS, NR_DMA_REC_HPOS, GetCustomRegsAfterDma, CpuCyclesToDmaCycles, GetColorCss } from '../dma';
import { GfxResourceType, GfxResource, GfxResourceFlags } from '../../backend/profile_types';
import { createPortal } from 'preact/compat';

@@ -349,7 +349,7 @@ const GfxResourceItem: FunctionComponent<DropdownOptionProps<GfxResourceWithPayl
</Fragment>)}
{resource.type === GfxResourceType.palette && (<Fragment>
<div class={styles.palette}>
{option.palette.slice(0, option.palette.length >>> 1).map((p) => <div style={{ backgroundColor: `#${(p & 0xffffff).toString(16).padStart(6, '0')}` }} />)}
{option.palette.slice(0, option.palette.length >>> 1).map((p) => <div style={{ backgroundColor: GetColorCss(p) }} />)}
</div>
</Fragment>)}
</dd>
25 changes: 20 additions & 5 deletions src/client/dma.ts
Original file line number Diff line number Diff line change
@@ -240,7 +240,7 @@ export function GetBlits(customRegs: Uint16Array, dmaRecords: DmaRecord[]): Blit
let BLTSIZV = 0;
if(reg === regBLTSIZE - 0xdff000) { // OCS
BLTSIZH = dmaRecord.dat & 0x3f;
BLTSIZV = dmaRecord.dat >>> 6;
BLTSIZV = (dmaRecord.dat >>> 6) & 0x3ff;
if(BLTSIZH === 0)
BLTSIZH = 64;
if(BLTSIZV === 0)
@@ -300,6 +300,9 @@ export function GetBlits(customRegs: Uint16Array, dmaRecords: DmaRecord[]): Blit
}
}
}

console.log(BlitTrace);

return blits;
}

@@ -531,22 +534,34 @@ export function GetNextCustomRegWriteTime(index: number, cycle: number, dmaRecor
return undefined;
}

// AABBGGRR
function GetAmigaColor(color: number): number {
return (((((color >>> 8) & 0xf) << 4) | ((color >>> 8) & 0xf)) << 0) | // RR
(((((color >>> 4) & 0xf) << 4) | ((color >>> 4) & 0xf)) << 8) | // GG
(((((color >>> 0) & 0xf) << 4) | ((color >>> 0) & 0xf)) << 16) | // BB
(((((color >>> 4) & 0xf) << 4) | ((color >>> 4) & 0xf)) << 8) | // GG
(((((color >>> 0) & 0xf) << 4) | ((color >>> 0) & 0xf)) << 16) | // BB
0xff000000; // AA
}

// AABBGGRR <-> AARRGGBB
function ColorSwap(color: number): number {
return ((color >>> 16) & 0xff) | (((color >>> 0) & 0xff) << 16) | (color & 0xff00ff00);
}

// AABBGGRR
export function GetColorCss(color: number): string {
return '#' + (ColorSwap(color) & 0xffffff).toString(16).padStart(6, '0');
}

// 0RGB
export function GetAmigaColorCss(color: number): string {
return '#' + (GetAmigaColor(color) & 0xffffff).toString(16).padStart(6, '0');
return '#' + (ColorSwap(GetAmigaColor(color)) & 0xffffff).toString(16).padStart(6, '0');
}

function GetAmigaColorEhb(color: number): number {
return GetAmigaColor((color & 0xeee) >>> 1);
}

// returns 64-element array of 32-bit ARGB colors (0x00-0xff)
// returns 64-element array of 32-bit ABGR colors (0x00-0xff)
export function GetPaletteFromCustomRegs(customRegs: Uint16Array): number[] {
const customReg = (reg: number) => customRegs[(reg - 0xdff000) >>> 1];
const regCOLOR = CustomRegisters.getCustomAddress("COLOR00");

0 comments on commit da75e60

Please sign in to comment.