This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool InputTextRightAligned(const char* label, const char* text, size_t length, ImGuiInputTextFlags flags, ImGuiInputTextCallback pCallback, void* pUserData) | |
{ | |
const ImGuiContext& g = *ImGui::GetCurrentContext(); | |
const ImGuiStyle& style = ImGui::GetStyle(); | |
ImGuiWindow& window = *ImGui::GetCurrentWindow(); | |
ImGuiID id = window.GetID(label); | |
bool active = g.ActiveId == id; | |
ImVec2 labelSize = ImGui::CalcTextSize(label, nullptr, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;***************************************************************** | |
; ZX7 decompressor based on | |
; ZX7 data decompressor for Apple II | |
; by Peter Ferrie (peter.ferrie@gmail.com) | |
; with modifications by Juan J. Martinez (@reidrac) | |
; optimized by Petri Häkkinen | |
; This code is in the Public Domain | |
;***************************************************************** | |
zx7_src_lo = $20 ; should always contain 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;***************************************************************** | |
; negate accumulator | |
;***************************************************************** | |
neg: eor #$ff | |
clc | |
adc #1 | |
rts | |
;***************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- sublime text 3 autcomplete dialog width is hardcoded to 300 pixels | |
-- this lua script changes it to 600 pixels by modifying the sublime text executable | |
-- backup the original executable before running the patch! | |
local filename = "c:/program files/sublime text 3/sublime_text.exe" | |
local hex = function(t) | |
local s = "" | |
for i=1,#t do | |
s = s..string.char(t[i]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uint8_t rom[] = { | |
// clear screen | |
// screen memory starts at $c000 and is 50*25 = 1600 bytes long | |
// clear first 6*256 = 1536 bytes | |
0xa9, 32, // lda #32 'space' | |
0xa2, 0, // ldx #0 | |
//clearloop: | |
0x9d, 0x00, 0xc0, // sta $c000,x | |
0x9d, 0x00, 0xc1, // sta $c100,x | |
0x9d, 0x00, 0xc2, // sta $c200,x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; copy 128 bytes, 6 cycles per byte (768 cycles) | |
.rept 128 | |
out _SFR_IO_ADDR(PORTA), ZL ; PORTA = lo | |
addi ZL, 1 | |
nop | |
in r24, _SFR_IO_ADDR(PINC) ; r24 = data | |
st X+, r24 | |
.endr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; halt CPU (20 cycles) | |
sts TCCR2B, r0 ; TCCR2B = 0 | |
call delay16 ; wait a while so that the 6502 can finish whatever it was doing | |
cbi _SFR_IO_ADDR(PORTD), BUS_ENABLE ; disable bus | |
; ATmega can now do whatever dirty tricks it likes in the memory | |
; restart CPU (5 cycles) | |
sbi _SFR_IO_ADDR(PORTD), BUS_ENABLE ; enable bus | |
ldi r24, 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; phase 1: 6502 is bus master (8 cycles) | |
; prepare atmega for memory access by preloading address (address lines are still inputs so this will only affect internal pull up resistors) | |
out PORTA, lo ; load lo address | |
out PORTB, hi ; load hi address | |
st X+, data ; store data received in previous phase 0 | |
adiw address, 1 ; increment address | |
nop | |
nop | |
; phase 0: atmega is bus master (8 cycles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stop CPU clock in high state | |
void stopClock() { | |
// wait for clock to go low | |
while((PIND & CPU_CLOCK) != 0) {} | |
// wait for clock to go high | |
// must check that WE is high, otherwise CPU may be writing to memory | |
while((PIND & (CPU_CLOCK|SRAM_WE)) == 0) {} | |
TCCR2B = 0; // stop timer by setting prescaler to 0 | |
TCCR2A = 0; // disable timer so that we can control PD7 manually | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uint8_t rom[] = { | |
0xa2, 0xff, // ldx #$ff | |
0xca, // dex | |
0xd0, 0xfd, // bne $ff02 (relative address $fd = -3) | |
0xe6, 0x10, // inc $10 | |
0x4c, 0x00, 0xf0, // jmp $f000 | |
}; |
NewerOlder