|
Joined: Mar 2001
Posts: 17,217 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,217 Likes: 234 |
Here's a quality-of-life improvement for the 8-bit A2s: the disassembler now knows about Monitor ROM entry points, soft switches, and common zero-page locations. ProDOS MLI parsing is to come, as is full IIgs support for Toolbox and GS/OS calls and bank $E0/$E1 globals.
Last edited by R. Belmont; 02/23/19 01:26 PM.
|
|
|
|
Joined: Jun 2014
Posts: 95 Likes: 3
Member
|
Member
Joined: Jun 2014
Posts: 95 Likes: 3 |
That's awesome. I'm always forgetting the names of some of those. By the way, $FADA is RGDSP1.
|
|
|
|
Joined: Mar 2001
Posts: 17,217 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,217 Likes: 234 |
$FADA wasn't in the lists I was using, but I'll add it.
The version going in also shows ProDOS 8 calls and lets you step over them cleanly.
|
|
|
|
Joined: May 1999
Posts: 616 Likes: 1
Senior Member
|
Senior Member
Joined: May 1999
Posts: 616 Likes: 1 |
That's very cool. Out of curiosity, does this exist for other systems?
|
|
|
|
Joined: Mar 2001
Posts: 17,217 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,217 Likes: 234 |
There's a few others (the Mac, Palm, and TRS-80 Color Computers), and it's pretty easy to add more. The downside is that as it's currently implemented, it's pretty low-level; your hook has the same power and responsibility as the CPU core disassemblers, except you can pass any opcode you don't want back to the core to deal with. It's probably easiest to do for A-line traps on 680x0 systems, which is why 2 of the existing 3 are 680x0.
Last edited by R. Belmont; 02/23/19 08:35 PM.
|
|
|
|
Joined: May 1999
Posts: 616 Likes: 1
Senior Member
|
Senior Member
Joined: May 1999
Posts: 616 Likes: 1 |
A-Traps? Now, there's something that reminds me my active programming years. And now I think of Scott Knasters's Mac programming books ... 😊
|
|
|
|
Joined: Jun 2014
Posts: 95 Likes: 3
Member
|
Member
Joined: Jun 2014
Posts: 95 Likes: 3 |
$FADA wasn't in the lists I was using, but I'll add it. I have the original monitor ROM source. I can add more of the labels for the next version. First, though, is to get II+ LC working properly. It's marked writable but writes are ignored until state is changed to read-only and then back to writable.
|
|
|
|
Joined: Jun 2014
Posts: 95 Likes: 3
Member
|
Member
Joined: Jun 2014
Posts: 95 Likes: 3 |
RB, related to that, while I'm adding the missing labels from the monitor source, shall I change the zpage labels to their original names? e.g. CURSORHORZ -> CH, TXTWIDTH -> WNDWDTH...
|
|
|
|
Joined: Mar 2001
Posts: 17,217 Likes: 234
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,217 Likes: 234 |
If you have canonical names for them, go ahead. I was working primarily off of http://www.kreativekorp.com/miscpages/a2info/zeropage.shtml which gives what they are but not the canonical names.
|
|
|
|
Joined: Feb 2014
Posts: 1,102 Likes: 173
Very Senior Member
|
Very Senior Member
Joined: Feb 2014
Posts: 1,102 Likes: 173 |
Some more silly fun: I always thought that Altirra's enhanced text mode was pretty cool, so why not see if I could do a text overlay with lua?
-- 80 column text overlay for Apple IIe
function calc(line,page) page=page or 0 return line % 8 * 1024 + math.floor(line / 64) * 40 + math.floor((line%64) / 8) * 128 + 8192* (page + 1) end
function iskeypressed(keycode)
inp = manager:machine():input() return inp:code_pressed(inp:code_from_token(keycode))
end
function striphi(a) if type(a)=="number" then a=string.char(a) end local b="" for i=1,#a do b=b..string.char(string.byte(a,i)&0x7f) end return b end
mem=manager:machine().devices[":maincpu"].spaces["program"]
aux=emu.item(manager:machine().devices[":aux:ext80"].items["0/m_ram"])
scr=manager:machine().screens[":screen"]
function widthpct(c) if c==nil or c==string.char(0) then return 0 end return ((manager:ui():get_string_width(c,1.0)/manager:ui():get_string_width("A",1.0))) end
function widthoffset(c) if c==nil or c==string.char(0) then return 0 end return 3.5*(1-widthpct(c)) end
drawoverlay=true
keydelay=0
function print_80col()
for y=0,23 do for x=0,39 do offset=calc(y*8)-8192+x
c1=striphi(aux:read(1024+offset)) c0=striphi(mem:read_u8(1024+offset))
io.write(c1..c0) end print() end
end
function draw_80col()
if keydelay > 0 then keydelay = keydelay - 1 end
if drawoverlay then
scr:draw_box(0,0,559,279,0xff000000,0xffffffff)for y=0,23 do for x=0,39 do offset=calc(y*8)-8192+x
c1=striphi(aux:read(1024+offset)) c0=striphi(mem:read_u8(1024+offset))
scr:draw_text((x*2+0)*7+widthoffset(c1),y*8,c1,0xffffffff,0xff000000) scr:draw_text((x*2+1)*7+widthoffset(c0),y*8,c0,0xffffffff,0xff000000) end end
end
if iskeypressed("KEYCODE_LSHIFT") and keydelay==0 then drawoverlay=not drawoverlay keydelay=20 end
end
draw80dispatchlist={draw_80col}
function draw80dispatch() for i,j in pairs(draw80dispatchlist) do j() end end
function drawon() draw80dispatchlist={draw_80col} end
function drawoff() draw80dispatchlist={} end
if not alreadyregistereddraw80 then
emu.register_frame_done(draw80dispatch)
alreadyregistereddraw80=true
end
With overlay: Without overlay: Just hit the shift key to toggle it on/off It took me a while to figure out why it looks strange when it's scrolling in 80 columns. Reading with manager:machine().devices[":maincpu"].spaces["program"]:read_u8() gets the data from the auxiliary memory when the softswitches are set during the scroll.
Last edited by Golden Child; 03/03/19 01:42 AM.
|
|
|
1 members (AJR),
243
guests, and
5
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,320
Posts121,944
Members5,074
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|