News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: BASIC and ZZT hacking: Need DOS Basic compiler that can use actual ASM in code.  (Read 2693 times)

Hamtaro126

  • Full Member
  • ***
  • Posts: 174
  • R.I.P. 2006-2012
    • View Profile
EDIT: Even though ZZT can be hackable, and many people do hack it, That ZZT and SuperZZT is a Hackable Freeware, Tim Sweeny and Epic allows it because of no source code. And therefore, using utilities like UNLZEXE and TSRs are allowed.

So that means that it is not a bad thing to post help here for ZZT and SuperZZT, Hopefully...

---------------------------------

I'm using the pseudo-code for hacking ZZT to graphics mode as a TSR...

Code: [Select]
; Arguments: cx = character-cell X, cy = character-cell Y
; c = character code, f = foreground color, b = background color

videooffset = ((cy * 80) * 14) + cx; base address of the character cell on each plane
videobase = $A000; the start of EGA memory
characterseg = (? >> 4); where ? = the base address of your character set
characterbase = (? & $0F) + (c * 14); as above

for i = 0 to 13
DEF SEG characterseg; or however this is represented in x86 assembly
load A, (characterbase + i); the register names are all dummies here, use whatever works
DEF SEG videobase; set to write to video RAM
for j = 0 to 3
out $3C4, 2; a bit of voodoo programming to select the plane to access, since low-level EGA documentation
out $3C5, (1 << i); seems very hard to find
if (f & (1 << j) != 0) and (b & (1 << j) != 0) then store $FF, (videooffset + lineoffset)
else if (f & (1 << j) != 0) then store A, (videooffset + lineoffset)
else if (b & (1 << j) != 0) then store (A XOR $FF), (videooffset + lineoffset)
else store $00, (videooffset)
next
videooffset += 80
next

First, What (free) BASIC for DOS can combine Basic and ASM in one source? Need to have a way to convert both.

Second, can use DIM on the equals signs, but I must know how to convert it,

Third, This utility can be modded for better color palette options and SZZT support...
« Last Edit: September 07, 2011, 02:59:45 am by Hamtaro126 »
(Ban is Repealed because of refusal to accept action. Making this major problem worse, So if no-one tempbans me, I WILL NOT COME BACK PERMANENTLY)

Erase this when you are ready to act like a MAN!!!

syntax error

  • Full Member
  • ***
  • Posts: 227
    • View Profile
Wasnt ZZT written in Turbo Pascal?

Jorpho

  • Hero Member
  • *****
  • Posts: 4161
  • The cat screams with the voice of a man.
    • View Profile
Wasnt ZZT written in Turbo Pascal?
Yes, but I believe Mr. Hamtaro is seeking to write an external program that modifies the ZZT program once it is loaded into memory, and is using BASIC for lack of alternative programming knowledge, amirite?

Didn't someone do something similar a few years back?  Something called "Enhanced ZZT" ?  It featured a partial remake of Caverns of Zeux.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Hamtaro126

  • Full Member
  • ***
  • Posts: 174
  • R.I.P. 2006-2012
    • View Profile
BASIC can be simple, But 6502/Partial X86 Hacking/ASM is understandable to me,

EZZT is a dead project since most projects using it is pretty much uneditable, and no source code for that either, I can try to make a disassembly using the Open-Source TatraDAS Interactive Disassembler, Since it is what I am originally after,

And since I use Dosbox, a lack of a DEBUGGER with good features and a screen viewer does not help... I may ask the author for a debugger, but focusing on the main task is my concern...

http://tatradas.sourceforge.net/

The problem is remaking and reassembling the Extended DOS Header in the binary at 0x00000000-0x00001c00 for ZZT and SuperZZT, is it in Relocatible Format?

Current header format explanation from my notes:

0x0000-0x001f = DOS Header
0x0020-0x1c00 = ZZT/SZZT/TurboPascal7 Header Extention? (Unknown addresses loaded in exeecutable RAM)
(Ban is Repealed because of refusal to accept action. Making this major problem worse, So if no-one tempbans me, I WILL NOT COME BACK PERMANENTLY)

Erase this when you are ready to act like a MAN!!!

Azkadellia

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 868
  • 提交向你的情妇!
    • View Profile
    • Princess Translations
Current Projects: On hold indefinitely.
I do the Twitter thing now: https://twitter.com/MistressSaeko (expect lots of game streaming announcements)
Mistress of the RHDN Discord server.