Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
type
Tmytype = record
price: byte;
quantity: word;
end;
var
item: array[0..20] of Tmytype;
SetIntVec(iDLI, @dlic);
SetIntVec(iVBL, @vblc);
program SystemOff_test;
{$librarypath '../Libs/lib/';'../Libs/blibs/';'../Libs/base/'}
uses atari, b_utils, b_system, b_crt, sysutils;
const
CHARSET_ADDRESS = $4000;
DISPLAY_LIST_ADDRESS_MENU = CHARSET_ADDRESS + $400;
DISPLAY_LIST_ADDRESS_CONSOLE = DISPLAY_LIST_ADDRESS_MENU + $100;
TXT_ADDRESS = $5000;
SCROLL_ADDRESS = TXT_ADDRESS + $400; //$F0;
GFX_ADDRESS = $8000;
{$r 'systemoff_res.rc'}
var
oldvbl, olddli: pointer;
{$i 'interrupts.inc'}
{
--------------------------------------------------------------------------------
MAIN LOOP
--------------------------------------------------------------------------------
}
begin
SystemOff;
SetCharset (Hi(CHARSET_ADDRESS)); // when system is off
// savmsc:= TXT_ADDRESS;
// Waitframe;
// SDLSTL := DISPLAY_LIST_ADDRESS_MENU;
//
// GetIntVec(iVBL, oldvbl);
// GetIntVec(iDLI, olddli);
//
// //
// SetIntVec(iVBL, @vblc);
// SetIntVec(iDLI, @dlic);
// nmien:= $c0;
//
lmargin:= 0;
rmargin:= 0;
CRT_Init;
CRT_WriteCentered('Loading...'~);
repeat
until CRT_Keypressed;
// restore system
// SetIntVec(iVBL, oldvbl);
// SetIntVec(iDLI, olddli);
// nmien:= $40;
end.
main lda:cmp:req 20
sei
mva #0 nmien
sta dmactl
mva #$fe portb
mwa #nmi nmivec
mva #$40 nmien
jmp *
/* ----------------------------------------------------------- */
.local NMI
bit nmist
bpl vbl
dli rti
vbl sta nmist
sta regA
stx regX
sty regY
inc cloc
mwa #dlist dlptr
mva #scr40 dmactl
lda regA
ldx regX
ldy regY
rti
.endl
cd $(CURRENT_DIRECTORY)
mpas.bat $(FILE_NAME)
@echo off
d:\!Delphi\PAS6502\SP.exe %1
if exist %~dp1%~n1.a65 (
mads.exe %~dp1%~n1.a65 -xli:d:\!Delphi\Pas6502\base\
if exist %~dp1%~n1.obx altirra %~dp1%~n1.obx
)
ZPFREE: $0000..$007F
ZPFREE: $00D8..$00FF
STRINGS SIZE: $013D
STRINGS : $B800..$B93D
LOCATIONS SIZE: $010D
LOCATIONS : $BA00..$BB0D
ITEMS SIZE: $00F4
ITEMS : $BC00..$BCF4
SYSTEM: $21DA..$23AF
B_UTILS: $23B0..$2406
B_SYSTEM: $2407..$24F9
SYSUTILS: $24FA..$2530
B_CRT: $2531..$2A14
CODE: $2000..$5240
DATA: $5241..$747C
FREE_TOP = $8000;
CHARSET_ADDRESS = FREE_TOP;
DISPLAY_LIST_ADDRESS_MENU = CHARSET_ADDRESS + $400;
DISPLAY_LIST_ADDRESS_CONSOLE = DISPLAY_LIST_ADDRESS_MENU + $100;
TXT_ADDRESS = DISPLAY_LIST_ADDRESS_CONSOLE + $100;
SCROLL_ADDRESS = TXT_ADDRESS + $400;
GFX_ADDRESS = $A000;
STRINGS_ADDRESS = GFX_ADDRESS + $1800;
LOCATIONS_ADDRESS = STRINGS_ADDRESS + $200;
ITEMS_ADDRESS = LOCATIONS_ADDRESS + $200;
tebe:
jeśli masz większy blok pamięci do wyświetlenia, to układa się oba adresy tak aby zachodziły na siebiedlist:
dta $4e,a($a010) ; -> LMS -> $A010
:101 dta $e ; razem z LMS to 102 linie
dta $4e,a($b000) ; nowy LMS -> $B000
:101 dta $e ; razem z LMS to kolejne 102 linie
dta $41,a(dlist) ; w sumie wyświetlimy 204 linie
dl_start
dta DL_DLI + DL_BLANK8
dta DL_MODE_160x192G4 + DL_LMS, a(GFX_ADDRESS)
:99 dta DL_MODE_160x192G4
dta DL_DLI + DL_BLANK8
dta DL_MODE_40x24T2 + DL_LMS, a(TXT_ADDRESS)
:5 dta DL_MODE_40x24T2
dta DL_DLI + DL_BLANK8
dta DL_MODE_40x24T2 + DL_HSCROLL + DL_LMS, a(SCROLL_ADDRESS)
dta DL_JVB, a(dl_start)
DISPLAY_LIST_ADDRESS_MENU rcasm 'dlist_menu.asm'
DISPLAY_LIST_ADDRESS_CONSOLE rcasm 'dlist_console.asm'
ldy <fname
ldx >fname
jmp xBIOS_LOAD_FILE
function DeleteFile(var FileName: TString): Boolean; assembler;
asm
{ txa:pha
sec ; iocheck on
jsr @openfile.lookup
bmi stop
lda #33
sta iccmd,x
lda FileName
add #1
sta icbufa,x
lda FileName+1
adc #0
sta icbufa+1,x
lda #$00
sta icax1,x
sta icax2,x
jsr ciov
stop sty MAIN.SYSTEM.IOResult
bpl ok
lda #false
seq
ok lda #true
sta Result
pla:tax
};
end;
procedure xbios_loadfile(filename: TString);assembler;
asm {
ldy <filename+1
ldx >filename+1
jmp xBIOS_LOAD_FILE
};
end;
lda filename
clc
adc #1
tay
lda filename+1
adc #0
tax
adr.FILENAME = DATAORIGIN+$007A
.var FILENAME = adr.FILENAME .word
xBIOS = $800;
xBIOS_VERSION = xBIOS+$02;
xBIOS_LOAD_FILE = xBIOS+$06;
procedure xbios_loadfile(var filename: TString);assembler;
asm {
lda filename
clc
adc #1
tay
lda filename+1
adc #0
tax
jmp xBIOS_LOAD_FILE
};
end;
txa
pha
lda filename
clc
adc #1
tay
lda filename+1
adc #0
tax
jsr xBIOS_LOAD_FILE
pla
tax
asm {
lda filename
clc
adc #1
tay
lda filename+1
adc #0
tax
jmp xBIOS_LOAD_FILE
};
asm {
ldy filename
ldx filename+1
inx
sne
iny
jmp xBIOS_LOAD_FILE
};
mono:
Skoro wiadomo, że to powędruje do XY to czy nie można by byłotxa
pha
ldy filename
ldx filename+1
iny
sne
inx
jsr xBIOS_LOAD_FILE
pla
tax